login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A087844
a(n) = a(a(a(min(n-1, abs(n - a(n-1)))))) + a(abs(n - a(n-3))).
2
1, 1, 1, 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 8, 7, 8, 8, 8, 8, 8, 8, 10, 9, 10, 9, 10, 10, 10, 10, 10, 10, 13, 11, 12, 12, 12, 11, 13, 13, 13, 13, 13, 13, 13, 16, 14, 15, 16, 15, 15, 15, 14, 16, 16, 16, 16, 16, 16, 16, 16, 20, 17, 18, 16, 20, 19, 19, 20, 19, 19, 18, 20
OFFSET
1,4
LINKS
MAPLE
a:= proc(n) option remember: if n<4 then 1 else procname(procname(procname(min(n-1, abs(n-procname(n-1))))))+procname(abs(n-procname(n-3))) fi end:
seq(a(n), n=1..100); # Muniru A Asiru, Jun 02 2018
MATHEMATICA
a[n_Integer?Positive] := a[n] = a[ a[a[Min[n-1, Abs[n - a[n-1]]]]]] + a[Abs[n - a[n-3]]]
a[0] = a[1] = a[2] = a[3] = 1
Table[a[n], {n, 1, 200}]
PROG
(GAP) a:=[1, 1, 1];; for n in [4..100] do a[n]:=a[a[a[Minimum(n-1, AbsInt(n-a[n-1]))]]]+a[AbsInt(n-a[n-3])]; od; a; # Muniru A Asiru, Jun 02 2018
CROSSREFS
Sequence in context: A174901 A308411 A087848 * A287635 A189660 A194167
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Oct 07 2003
EXTENSIONS
Edited by N. J. A. Sloane, Jun 16 2007
STATUS
approved