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.

Showing 1-4 of 4 results.

A177443 Triangle, row sums = A007729; derived from the generator for A002487, Stern's diatomic series.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 3, 2, 0, 0, 3, 3, 2, 0, 0, 3, 3, 4, 0, 0, 0, 3, 3, 6, 1, 0, 0, 0, 3, 3, 6, 2, 0, 0, 0, 0, 3, 3, 6, 3, 3, 0, 0, 0, 0, 3, 3, 6, 3, 6, 0, 0, 0, 0, 0, 3, 3, 6, 3, 9, 2, 0, 0, 0, 0, 0, 3, 3, 6, 3, 9, 4, 0, 0, 0, 0, 0, 0, 3, 3, 6, 3, 9, 6, 3
Offset: 0

Views

Author

Gary W. Adamson, May 08 2010

Keywords

Comments

Rows apparently tend to 3 * nonzero terms of Stern's diatomic series; i.e.,
3 * (1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5,...) = (3, 3, 6, 3, 9, 6, 9, 3, 12,...)
Row sums = A007729: (1, 2, 4, 5, 8, 10, 13, 14, ...)

Examples

			First few rows of the triangle =
1;
2, 0;
3, 1, 0;
3, 2, 0, 0;
3, 3, 2, 0, 0;
3, 3, 4, 0, 0, 0;
3, 3, 6, 1, 0, 0, 0;
3, 3, 6, 2, 0, 0, 0, 0;
3, 3, 6, 3, 3, 0, 0, 0, 0;
3, 3, 6, 3, 6, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 2, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 4, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 3, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 6, 0, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 9, 1, 0, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 9, 2, 0, 0, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 9, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 9, 3, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0;
3, 3, 6, 3, 9, 6, 9, 3, 12, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0;
...
		

Crossrefs

Formula

Triangle read by rows, Q*R*S; where Q = an infinite lower triangular matrix with all 1's, R = the generator for A002487, and S = a diagonalized variant of A002487 (nonzero terms of A002487 as the right diagonal and the rest zeros). R, the generator for A002487 is an irregular lower triangular matrix with (1, 1, 1, 0, 0, 0,...) in each column; but each successive column for k>0 is shifted down twice from the previous column.

A072170 Square array T(n,k) (n >= 0, k >= 2) read by antidiagonals, where T(n,k) is the number of ways of writing n as Sum_{i>=0} c_i 2^i, c_i in {0,1,...,k-1}.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 2, 3, 2, 2, 1, 1, 1, 3, 3, 4, 2, 2, 1, 1, 1, 1, 4, 3, 4, 2, 2, 1, 1, 1, 4, 4, 5, 4, 4, 2, 2, 1, 1, 1, 3, 5, 4, 5, 4, 4, 2, 2, 1, 1, 1, 5, 5, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 2, 6, 6, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 5, 6, 9, 8, 9, 6, 6, 4, 4, 2, 2, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jun 29 2002

Keywords

Comments

k-th column is k-th binary partition function.
The sequence data corresponds (via the table link) to the transpose of the array shown in example and given by the definition. - M. F. Hasler, Feb 14 2019

Examples

			Array begins: (rows n >= 0, columns k >= 2)
1 1 1 1 1 1 1 1 ...
1 1 1 1 1 1 1 1 ...
1 2 2 2 2 2 2 2 ...
1 1 2 2 2 2 2 2 ...
1 3 3 4 4 4 4 4 ...
1 2 3 3 4 4 4 4 ...
1 3 4 5 5 6 6 6 ...
		

Crossrefs

k=3 column is A002487, k=4 is A008619 (positive integers repeated), k = 5, 6, 7 are A007728, A007729, A007730, limiting (infinity) column is A000123 doubled up.

Programs

  • Maple
    b:= proc(n, i, k) option remember;
          `if`(n=0, 1, `if`(i<0, 0, add(`if`(n-j*2^i<0, 0,
             b(n-j*2^i, i-1, k)), j=0..k-1)))
        end:
    T:= (n, k)-> b(n, ilog2(n), k):
    seq(seq(T(d+2-k, k), k=2..d+2), d=0..14); # Alois P. Heinz, Jun 21 2012
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 0, 0, Sum[If[n-j*2^i < 0, 0, b[n-j*2^i, i-1, k]], {j, 0, k-1}]]];
    t[n_, k_] := b[n, Length[IntegerDigits[n, 2]] - 1, k];
    Table[Table[t[d+2-k, k], {k, 2, d+2}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Jan 14 2014, translated from Alois P. Heinz's Maple code *)
  • PARI
    M72170=[[]]; A072170(n,k,i=logint(n+!n,2),r=1)={if( !i, k>n, r&&(k<5||k>=n),if(k>4, A000123(n\2)-(k==n), k<3, 1, k<4, A002487(n), n\2+1), M72170[r=setsearch(M72170,[n,k,i,""],1)-1][^-1]==[n,k,i], M72170[r][4], M72170=setunion(M72170,[[n,k,i,r=sum(j=0,min(k-1,n>>i),A072170(n-j*2^i,k,i-1,0))]]);r)} \\ Code for k<5 (using A002487 for k=3) and k>=n (using A000123) is optional but makes it about 3x faster. - M. F. Hasler, Feb 14 2019

Formula

T(n,k) = T(n,n+1) = T(n,n)+1 = A000123(floor(n/2)) for all k >= n+1. - M. F. Hasler, Feb 14 2019

A174868 Partial sums of Stern's diatomic series A002487.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 10, 13, 14, 18, 21, 26, 28, 33, 36, 40, 41, 46, 50, 57, 60, 68, 73, 80, 82, 89, 94, 102, 105, 112, 116, 121, 122, 128, 133, 142, 146, 157, 164, 174, 177, 188, 196, 209, 214, 226, 233, 242, 244, 253, 260, 272, 277, 290, 298, 309, 312, 322, 329, 340, 344, 353, 358, 364, 365, 372, 378, 389, 394, 408, 417, 430, 434, 449, 460, 478, 485, 502, 512, 525, 528, 542, 553, 572, 580, 601, 614, 632, 637, 654, 666, 685
Offset: 0

Views

Author

Jonathan Vos Post, Dec 01 2010

Keywords

Comments

After the initial 0, identical to A007729.

Examples

			a(16) = 0 + 1 + 1 + 2 + 1 + 3 + 2 + 3 + 1 + 4 + 3 + 5 + 2 + 5 + 3 + 4 + 1 = 41.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[EvenQ[n], 2*a[n/2] + a[n/2 - 1], 2*a[(n - 1)/2] + a[(n + 1)/2]]; a[0] = 0; a[1] = 1; Array[a, 100, 0] (* Amiram Eldar, May 18 2023 *)
  • Python
    from itertools import accumulate, count, islice
    from functools import reduce
    def A174868_gen(): # generator of terms
        return accumulate((sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0))) for n in count(1)),initial=0)
    A174868_list = list(islice(A174868_gen(),30)) # Chai Wah Wu, May 07 2023

Formula

a(n) = Sum_{i=0..n} A002487(i).
G.f.: (x/(1 - x))*Product_{k>=0} (1 + x^(2^k) + x^(2^(k+1))). - Ilya Gutkovskiy, Feb 27 2017
a(2k) = 2*a(k) + a(k-1); a(2k+1) = 2*a(k) + a(k+1). - Michael J. Collins, Dec 25 2018
a(n) = n^log_2(3) + Psi_D(log_2(n)) + O(n^log_2(phi)), where phi is the golden ratio (A001622) and Psi_D is a 1-periodic continuous function which is Hölder continuous with any exponent smaller than log_2(3/phi) (Heuberger et al., 2022). - Amiram Eldar, May 18 2023

A166556 Triangle read by rows, A000012 * A047999.

Original entry on oeis.org

1, 2, 1, 3, 1, 1, 4, 2, 2, 1, 5, 2, 2, 1, 1, 6, 3, 2, 1, 2, 1, 7, 3, 3, 1, 3, 1, 1, 8, 4, 4, 2, 4, 2, 2, 1, 9, 4, 4, 2, 4, 2, 2, 1, 1, 10, 5, 4, 2, 4, 2, 2, 1, 2, 1, 11, 5, 5, 2, 4, 2, 2, 1, 3, 1, 1, 12, 6, 6, 3, 4, 2, 2, 1, 4, 2, 2, 1
Offset: 0

Views

Author

Gary W. Adamson, Oct 17 2009

Keywords

Examples

			First few rows of the triangle =
   1;
   2, 1;
   3, 1, 1;
   4, 2, 2, 1;
   5, 2, 2, 1, 1;
   6, 3, 2, 1, 2, 1;
   7, 3, 3, 1, 3, 1, 1;
   8, 4, 4, 2, 4, 2, 2, 1;
   9, 4, 4, 2, 4, 2, 2, 1, 1;
  10, 5, 4, 2, 4, 2, 2, 1, 2, 1;
  11, 5, 5, 2, 4, 2, 2, 1, 3, 1, 1;
  12, 6, 6, 3, 4, 2, 2, 1, 4, 2, 2, 1;
  13, 6, 6, 3, 5, 2, 2, 1, 5, 2, 2, 1, 1;
  ...
		

Crossrefs

Sums include: A006046 (row), A007729 (diagonal).

Programs

  • Magma
    A166556:= func< n,k | (&+[(Binomial(j,k) mod 2): j in [k..n]]) >;
    [A166556(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 02 2024
    
  • Maple
    A166556 := proc(n,k)
        local j;
        add(A047999(j,k),j=k..n) ;
    end proc: # R. J. Mathar, Jul 21 2016
  • Mathematica
    A166556[n_, k_]:= Sum[Mod[Binomial[j,k], 2], {j,k,n}];
    Table[A166556[n,k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Dec 02 2024 *)
  • Python
    def A166556(n,k): return sum(binomial(j,k)%2 for j in range(k,n+1))
    print(flatten([[A166556(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Dec 02 2024

Formula

Triangle read by rows, A000012 * A047999; where A000012 = an infinite lower triangular matrix with all 1's: [1; 1,1; 1,1,1;..]; and A047999 = Sierpinski's gasket.
The operation takes partial sums of Sierpinski's gasket terms, by columns.
From G. C. Greubel, Dec 02 2024: (Start)
T(n, k) = Sum_{j=k..n} (binomial(j,k) mod 2).
T(n, 0) = A000027(n+1).
T(n, 1) = A004526(n+1).
T(n, 2) = A004524(n+1).
T(2*n, n) = A080100(n).
Sum_{k=0..n} T(n, k) = A006046(n+1).
Sum_{k=0..n} (-1)^k*T(n, k) = A006046(floor(n/2)+1).
Sum_{k=0..floor(n/2)} T(n-k, k) = A007729(n). (End)
Showing 1-4 of 4 results.