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!)
A091311 Partial sums of 3^A007814(n). 1

%I #6 Jul 08 2022 08:23:30

%S 0,1,4,5,14,15,18,19,46,47,50,51,60,61,64,65,146,147,150,151,160,161,

%T 164,165,192,193,196,197,206,207,210,211,454,455,458,459,468,469,472,

%U 473,500,501,504,505,514,515,518,519,600,601,604,605,614,615,618,619

%N Partial sums of 3^A007814(n).

%F Recurrence: a(2n) = 3a(n) + n, a(2n+1) = 3a(n) + n + 1.

%F G.f.: 1/(1-x) * sum(k>=0, 3^k*t/(1-t^2), t=x^2^k).

%o (PARI) a(n)=sum(k=1,n,3^valuation(n,2))

%o (PARI) a(n)=if(n<1,0,if(n%2==0,3*a(n/2)+n/2,3*a((n-1)/2)+(n+1)/2))

%o (Python)

%o def A091311(n): return (int(bin(n)[2:],3)<<1)-n # _Chai Wah Wu_, Jul 07 2022

%Y First differences are A061393(n)-1.

%Y Equals 2*A005836(n) - n.

%K nonn,easy

%O 0,3

%A _Ralf Stephan_, Feb 24 2004

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 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)