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!)
A215675 a(1) = 1, a(n) = 2 if 1<n<=3, a(2n+1) = a(n)+1, a(2n+2) = a(n)+a(n+1)+1 otherwise. 4

%I #23 Apr 24 2022 06:30:51

%S 1,2,2,4,3,5,3,7,5,8,4,9,6,9,4,11,8,13,6,14,9,13,5,14,10,16,7,16,10,

%T 14,5,16,12,20,9,22,14,20,7,21,15,24,10,23,14,19,6,20,15,25,11,27,17,

%U 24,8,24,17,27,11,25,15,20,6,22,17,29,13,33,21,30,10

%N a(1) = 1, a(n) = 2 if 1<n<=3, a(2n+1) = a(n)+1, a(2n+2) = a(n)+a(n+1)+1 otherwise.

%C In the S.-H. Cha reference this is function ~fog_2(n).

%H Alois P. Heinz, <a href="/A215675/b215675.txt">Table of n, a(n) for n = 1..8192</a>

%H S.-H. Cha, <a href="http://csis.pace.edu/~scha/IS/FOGKN.pdf">On Parity based Divide and Conquer Recursive Functions</a>, International Conference on Computer Science and Applications, San Francisco, USA, 24-26 October 2012.

%F G.f. A(x) satisfies: A(x) = x/(1 - x) + (1 + x + x^2) * A(x^2). - _Ilya Gutkovskiy_, May 23 2020

%p a:= proc(n) option remember; 1+ `if`(n=1, 0, `if`(n<=3, 1,

%p `if`(irem(n-1, 2, 'r')=0, a(r), a(r)+a(r+1))))

%p end:

%p seq (a(n), n=1..80); # _Alois P. Heinz_, Aug 23 2012

%t a[n_] := a[n] = If[n < 3, n, {q, r} = QuotientRemainder[n, 2];

%t Switch[r, 1, a[q] + 1, 0, a[q-1] + a[q] + 1]];

%t Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Apr 24 2022 *)

%Y Cf. A215673, A215674, A215676.

%K nonn

%O 1,2

%A _Sung-Hyuk Cha_, Aug 20 2012

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 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)