OFFSET
1,4
COMMENTS
A solution to recursion of Mallows's sequence (A005229).
LINKS
FORMULA
a(n+1) - a(n) = 0 or 1 for all n >= 1.
MATHEMATICA
a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n - 2]] + a[n - a[n - 2]]; Array[a, 81] (* Michael De Vlieger, Jun 11 2018 *)
PROG
(PARI) a=vector(100); a[1]=a[2]=a[3]=1; for(n=4, #a, a[n] = a[a[n-2]] + a[n-a[n-2]]); a
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Jun 11 2018
STATUS
approved