cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A130252 Partial sums of A130250.

Original entry on oeis.org

0, 1, 4, 7, 11, 15, 20, 25, 30, 35, 40, 45, 51, 57, 63, 69, 75, 81, 87, 93, 99, 105, 112, 119, 126, 133, 140, 147, 154, 161, 168, 175, 182, 189, 196, 203, 210, 217, 224, 231, 238, 245, 252, 259, 267, 275, 283, 291, 299, 307, 315, 323, 331, 339, 347, 355, 363, 371
Offset: 0

Views

Author

Hieronymus Fischer, May 20 2007

Keywords

Comments

If the initial zero is omitted, partial sums of A130253.

Crossrefs

Programs

  • Magma
    A001045:= func< n | (2^n - (-1)^n)/3 >;
    A130252:= func< n | n eq 0 select 0 else (2*n*Ceiling(Log(2, 3*n-1)) - A001045(Ceiling(Log(2,3*n-1)) +1) +1)/2 >;
    [A130252(n): n in [0..70]]; // G. C. Greubel, Mar 18 2023
    
  • Mathematica
    A001045[n_]:= (2^n - (-1)^n)/3;
    A130252[n_]:= If[n==0, 0, (2*n*Ceiling[Log[2,3*n-1]] - A001045[Ceiling[Log[2,3*n-1]]+1] +1)/2];
    Table[A130252[n], {n,0,70}] (* G. C. Greubel, Mar 18 2023 *)
  • Python
    def A130252(n): return n*(m:=(3*n-1).bit_length())-(((1<>1) # Chai Wah Wu, Apr 17 2025
  • SageMath
    def A001045(n): return (2^n - (-1)^n)/3
    def A130252(n): return 0 if (n==0) else (2*n*ceil(log(3*n-1,2)) - A001045(ceil(log(3*n-1,2)) +1) +1)/2
    [A130252(n) for n in range(71)] # G. C. Greubel, Mar 18 2023
    

Formula

a(n) = Sum_{k=0..n} A130250(k).
a(n) = n*ceiling(log_2(3n-1)) - (1/2)*( A001045(ceiling(log_2(3n-1)) +1) - 1 ).
G.f.: (1/(1-x)^2)*Sum_{k>=0} x^A001045(k).