OFFSET
1,4
COMMENTS
Conjecture: a(F_n) = F_{n-2} for n>1, where F_n is the n-th Fibonacci number.
Conjecture: a(n) ~ n*(3-sqrt(5))/2. -Jeffrey Shallit, Oct 12 2022
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
Marcel Celaya and Frank Ruskey, Morphic words and nested recurrence relations, arxiv 1307.0153 (Jun 29 2013), [math.CO] (see page 11).
FORMULA
a(n) = n - 1 - a(n-1) - a(a(n-2)) - a(a(a(n-3))) - a(a(a(a(n-4)))) - ... with a(n) = 0 if n <= 1.
MAPLE
a:= proc(n) option remember; local i, r, s;
if n<2 then 0 else r, s:= n, 1;
for i while s>0 do r, s:= r-s, (a@@i)(n-i) od: r
fi
end:
seq(a(n), n=1..100); # Alois P. Heinz, Jul 04 2013
MATHEMATICA
a[n_] := a[n]= Which[n <= 1, 0, True, n - 1 -Sum[Nest[a, n - i, i], {i, 1, n}]]; Table[a[i], {i, 0, 30}] (* José María Grau Ribas, Jul 10 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank Ruskey, Jul 04 2013
STATUS
approved