login
A087816
a(n) = a(a(n-1)) + a(n - 1 - a(n-1)) with a(1) = a(2) = 1.
2
1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 5, 6, 7, 8, 8, 8, 8, 8, 9, 9, 9, 10, 10, 11, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 20, 21, 21, 21, 22, 22, 23, 24, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 34, 34, 34
OFFSET
1,3
FORMULA
From Peter Bala, Sep 11 2022: (Start)
a(n) = n + 1 - A004001(n+1).
a(n) = A080677(n+1) - 1.
a(n+1) - a(n) = 0 or 1. (End)
MAPLE
A087816 := proc(n) option remember; if n <= 2 then 1 else procname(procname(n-1)) + procname(n - 1 - procname(n-1)); fi; end;
seq(A087816(n), n = 1..100); # Peter Bala, Sep 11 2022
MATHEMATICA
hg[n_Integer?Positive] := hg[n] =hg[hg[n-1]] + hg[n -1- hg[n-1]] hg[1] = hg[2] = 1 digits=2^8 a=Table[hg[n], {n, 1, digits}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Oct 05 2003
STATUS
approved