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!)
A050025 a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1. 12

%I #17 May 03 2020 18:51:54

%S 1,1,1,2,3,5,6,7,8,15,21,26,29,31,32,33,34,67,99,130,159,185,206,221,

%T 229,236,242,247,250,252,253,254,255,509,762,1014,1264,1511,1753,1989,

%U 2218,2439,2645,2830,2989,3119,3218,3285,3319

%N a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1.

%H Ivan Neretin, <a href="/A050025/b050025.txt">Table of n, a(n) for n = 1..8193</a>

%p a := proc(n) option remember;

%p `if`(n < 4, 1, a(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n)); end proc;

%p seq(a(n), n = 1 .. 48); # _Petros Hadjicostas_, Nov 08 2019

%t Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 1}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* _Ivan Neretin_, Sep 06 2015 *)

%o (PARI) lista(nn) = {nn = max(nn,3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 1; for(n=4, nn, va[n] = va[n-1] + va[2*2^logint(n-2, 2) + 2 - n]); va;} \\ _Petros Hadjicostas_, May 03 2020

%K nonn

%O 1,4

%A _Clark Kimberling_

%E Name edited by _Petros Hadjicostas_, Nov 08 2019

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