login
A086835
a(n) = a( (n - a(n-1))*(n mod 2) + a(n-1)*(1 - (n mod 2)) ) + a( (n - a(n-2))*(n mod 2) + (n - a(n-1))*(1 - (n mod 2)) ), with a(1) = a(2) = 1.
1
1, 1, 2, 2, 4, 3, 4, 4, 8, 5, 5, 8, 8, 7, 8, 8, 16, 9, 7, 12, 15, 12, 9, 16, 16, 13, 12, 16, 24, 19, 12, 20, 23, 14, 23, 17, 19, 14, 28, 24, 24, 25, 16, 24, 39, 32, 12, 25, 35, 31, 20, 32, 38, 22, 39, 44, 17, 40, 32, 36, 40, 36, 21, 31, 38, 30, 43, 32, 32, 34, 47, 28, 52, 44, 21, 54
OFFSET
1,3
LINKS
MATHEMATICA
Hc[n_]:= Hc[n] = If[n<3, 1, Hc[(n - Hc[n-1])*(Mod[n, 2]) + Hc[n-1]*(1 -Mod[n, 2])] + Hc[(n - Hc[n-2])*(Mod[n, 2]) + (n - Hc[n-1])*(1 - Mod[n, 2])]];
Table[Hc[n], {n, 100}]
PROG
(SageMath)
@CachedFunction
def Hc(n):
if (n<3): return 1
else: return Hc((n - Hc(n-1))*(n%2) + Hc(n-1)*(1-(n%2))) + Hc((n - Hc(n-2))*(n%2) + (n - Hc(n-1))*(1 -(n%2)))
[Hc(n) for n in range(1, 100)] # G. C. Greubel, Dec 05 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Sep 15 2003
EXTENSIONS
Edited by G. C. Greubel, Dec 05 2022
STATUS
approved