OFFSET
0,4
COMMENTS
"Limited chaotic sequence" based on A005229.
a(n) = 0 for n > 16.
MATHEMATICA
a[0] = 0; a[1] = a[2] = 1; a[n_] := a[n] = If[a[n - 2] < n, a[a[n - 2]] + a[n - 1 - Abs[a[n - 1] - a[n - 2]]], 0]; Array[a, 32, 0] (* JungHwan Min, Jan 14 2017 *)
PROG
(PARI) M(n)=v[n+1] {m=32; v=vector(m+1); v[1]=0; v[2]=1; v[3]=1; for(n=3, m, c=M(n-2); v[n+1]=if(c<n, M(c)+M(n-1-abs(M(n-1)-c)), 0)); for(j=0, m, print1(M(j), ", "))}
CROSSREFS
KEYWORD
nonn,fini,full,less
AUTHOR
Roger L. Bagula, Mar 19 2006
EXTENSIONS
Edited by N. J. A. Sloane, Apr 10 2006 and Apr 16 2006
Definition corrected by JungHwan Min, Jan 14 2017
STATUS
approved