login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #15 Dec 05 2022 04:41:57

%S 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,

%T 19,12,20,23,14,23,17,19,14,28,24,24,25,16,24,39,32,12,25,35,31,20,32,

%U 38,22,39,44,17,40,32,36,40,36,21,31,38,30,43,32,32,34,47,28,52,44,21,54

%N 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.

%H G. C. Greubel, <a href="/A086835/b086835.txt">Table of n, a(n) for n = 1..5000</a>

%t 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])]];

%t Table[Hc[n], {n, 100}]

%o (SageMath)

%o @CachedFunction

%o def Hc(n):

%o if (n<3): return 1

%o 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)))

%o [Hc(n) for n in range(1,100)] # _G. C. Greubel_, Dec 05 2022

%Y Cf. A004001, A005185, A086335.

%K nonn

%O 1,3

%A _Roger L. Bagula_, Sep 15 2003

%E Edited by _G. C. Greubel_, Dec 05 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 07:56 EDT 2024. Contains 371905 sequences. (Running on oeis4.)