OFFSET
1,4
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Altug Alkan, Plot of a(n)-n/2 for n<=2^20
Altug Alkan, Plot of (a(n-a(n-1))/n, a(a(n-1))/n) for n <= 250000
Rémy Sigrist, Colored scatterplot of (a(n-a(n-1))/n, a(a(n-1))/n) for n <= 100000000 (where the hue is function of n)
MATHEMATICA
Nest[Function[{a, n}, Append[a, n - a[[a[[-1]] ]] - a[[-a[[-1]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, 80] (* Michael De Vlieger, Aug 07 2018 *)
PROG
(PARI) q=vector(10000); q[1]=q[2]=1; for(n=3, #q, q[n]=n-q[q[n-1]]-q[n-q[n-1]]); q
(Magma) I:=[1, 1, 1, 2]; [n le 4 select I[n] else n - Self(Self(n-1)) - Self(n-Self(n-1)): n in [1..100]]; // Vincenzo Librandi, Aug 08 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jun 24 2017
STATUS
approved