OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
(h-> 2*a(n-h)-1+2*a(h))(iquo(n, 2)))
end:
seq(a(n), n=0..60); # Alois P. Heinz, Jul 26 2019
MATHEMATICA
a[n_] := a[n] = If[n < 2, n, 2 a[n-#] - 1 + 2 a[#]&[Quotient[n, 2]]];
a /@ Range[0, 60] (* Jean-François Alcover, Nov 04 2020, after Alois P. Heinz *)
PROG
(Magma) T:=[]; S:=[ 0: n in [1..2000] ]; k:=1; p:=Position(S, 0, 1); while p gt 0 do for j in [p..#S by k+1] do if S[j] eq 0 then S[j]:=k; else break; end if; end for; f:=p; Append(~T, p-1); p:=Position(S, 0, f); k+:=2; end while; T; // Klaus Brockhaus, Oct 25 2010
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Oct 24 2010
STATUS
approved