login
A302128
a(n) = a(a(n-2)) + a(n-a(n-1)) with a(1) = a(2) = a(3) = 1.
3
1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33
OFFSET
1,4
COMMENTS
A variation of the Hofstadter-Conway $10,000 sequence (A004001).
Similar with Newman generalization on A004001 (see A005350 and Kleitman's solution in Links section of A005350), a_i(n) is unbounded and slow sequence for all i >= 1 where a_i(n) = a_i(a_i(n-2)) + a_i(n-a_i(n-1)) with i + 1 initial conditions a_i(1) = a_i(2) = ... = a_i(i+1) = 1. In particular, a_1(n) = ceiling(n/2).
FORMULA
a(n+1) - a(n) = 0 or 1 for all n >= 1 and a(n) hits every positive integer.
MAPLE
a:=proc(n) option remember: if n<4 then 1 else procname(procname(n-2))+procname(n-procname(n-1)) fi; end: seq(a(n), n=1..100); # Muniru A Asiru, Jun 26 2018
PROG
(PARI) a=vector(99); for(n=1, 3, a[n] = 1); for(n=4, #a, a[n] = a[a[n-2]] + a[n-a[n-1]]); a
(GAP) a:=[1, 1, 1];; for n in [4..100] do a[n]:=a[a[n-2]]+a[n-a[n-1]]; od; a; # Muniru A Asiru, Jun 26 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Jun 20 2018
STATUS
approved