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

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

%S 1,2,2,4,4,3,5,5,3,7,7,5,9,9,5,8,8,4,9,9,6,11,11,6,9,9,4,11,11,8,15,

%T 15,8,13,13,6,15,15,10,19,19,10,15,15,6,14,14,9,17,17,9,13,13,5,14,14,

%U 10,19,19,10,16,16,7,18,18,12,23,23,12,18,18,7,16

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

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

%H Alois P. Heinz, <a href="/A215674/b215674.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

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

%p `if`(irem(n, 3, '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, 3];

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

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

%Y Cf. A215673, A215675, 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 August 18 10:50 EDT 2024. Contains 375264 sequences. (Running on oeis4.)