OFFSET
1,2
COMMENTS
LINKS
Nathan Fox, Table of n, a(n) for n = 1..10000
Nathan Fox, A Slow Relative of Hofstadter's Q-Sequence, arXiv preprint arXiv:1611.08244 [math.NT], 2016.
FORMULA
a(n) ~ 2n/3.
MATHEMATICA
a[n_] := a[n] = a[n - a[n -1]] + a[n - a[n -2]] + a[n - a[n -3]]; a[1] = 1; a[2] = 2; a[3] = 3; a[4] = 4; a[5] = 5; Array[a, 71] (* Robert G. Wilson v, Dec 02 2016 *)
PROG
(PARI) A=Vecsmall([]);
a(n)=if(n<7, return(n)); if(#A<n, A=concat(A, vectorsmall(n-#A)), if(A[n], return(A[n]))); A[n]=a(n-a(n-3)) + a(n-a(n-2)) + a(n-a(n-1)) \\ Charles R Greathouse IV, Nov 19 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Nathan Fox, Nov 10 2016
STATUS
approved