Divinacci Sequence
05AB1E, 9 bytes
XÎFDŠ‚ÑOO
Try it online!
Explanation
XÎ # initialize stack with 1,0,input
F # input times do
D # duplicate
Š # move down 2 places on the stack
‚ # pair the top 2 elements on the stack
Ñ # compute divisors of each
OO # sum twice
Mathematica, 45 40 bytes
If[#<3,1,Tr@Divisors@#0[#-i]~Sum~{i,2}]&
Mathematica's divisor related functions Divisors
, DivisorSum
and DivisorSigma
are all undefined for n = 0 (rightly so), so we start from f(1) = f(2) = 1
and don't support input 0
.
Defining it as an operator instead of using an unnamed function seems to be two bytes longer:
±1=±2=1
±n_:=Sum[Tr@Divisors@±(n-i),{i,2}]
Perl 6, 58 bytes
{my&d={sum grep $_%%*,1..$_};(0,1,{d($^a)+d $^b}...*)[$_]}
Try it online!