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-10 of 15 results. Next

A153006 Toothpick sequence starting at the outside corner of an infinite square from which protrudes a half toothpick.

Original entry on oeis.org

0, 1, 3, 6, 9, 13, 20, 28, 33, 37, 44, 53, 63, 78, 100, 120, 129, 133, 140, 149, 159, 174, 196, 217, 231, 246, 269, 297, 332, 384, 448, 496, 513, 517, 524, 533, 543, 558, 580, 601, 615, 630, 653, 681, 716, 768, 832, 881, 903, 918, 941
Offset: 0

Views

Author

Omar E. Pol, Dec 17 2008, Dec 19 2008, Apr 28 2009

Keywords

Comments

a(n) is the total number of integer toothpicks after n steps.
It appears that this sequence is related to triangular numbers, Mersenne primes and even perfect numbers. Conjecture: a(A000668(n))=A000217(A000668(n)). Conjecture: a(A000668(n))=A000396(n), assuming there are no odd perfect numbers.
The main entry for this sequence is A139250. See also A152980 (the first differences) and A147646.
The Mersenne prime conjectures are true, but aren't really about Mersenne primes. a(2^i-1) = 2^i (2^i-1)/2 for all i (whether or not i or 2^i-1 is prime). This follows from the formulas for A139250(2^i-1) and A139250(2^i). - David Applegate, May 11 2009
Then we can write a(A000225(k)) = A006516(k), for k > 0. - Omar E. Pol, May 23 2009
Equals A151550 convolved with [1, 2, 2, 2, ...]. (This is equivalent to the observation that the g.f. is x((1+x)/(1-x)) * Product_{n >= 1} (1 + x^(2^n-1) + 2*x^(2^n)).) Equivalently, equals A151555 convolved with A151575. - Gary W. Adamson, May 25 2009
It appears that a(n) is also 1/4 of the total path length of a toothpick structure as A139250 after n-th stage which is constructed following a special rule: toothpicks of the new generation have length 4 when are placed on the square grid (every toothpick has four components of length 1), but after every stage, one (or two) of the four components of every toothpick of the new generation is removed, if such component contains a endpoint of the toothpick and if such endpoint is touching the midpoint or the endpoint of another toothpick. The truncated endpoints of the toothpicks remain exposed forever. Note that there are three sizes of toothpicks in the structure: toothpicks of length 4, 3 and 2. a(n) is also 1/4 of the number of grid points that are covered after n-th stage, except the central point of the structure. A159795 gives the total path length and also the total number of components in the structure after n-th stage. - Omar E. Pol, Oct 24 2011

Crossrefs

Programs

  • Maple
    G:=x*((1 + x)/(1 - x)) * mul( (1 + x^(2^n-1) + 2*x^(2^n)), n=1..20); # N. J. A. Sloane, May 20 2009

Formula

G.f.: x*((1 + x)/(1 - x)) * Product_{n >= 1} (1 + x^(2^n-1) + 2*x^(2^n)). - N. J. A. Sloane, May 20 2009

Extensions

Edited by N. J. A. Sloane, Dec 19 2008

A152980 First differences of toothpick corner sequence A153006.

Original entry on oeis.org

1, 2, 3, 3, 4, 7, 8, 5, 4, 7, 9, 10, 15, 22, 20, 9, 4, 7, 9, 10, 15, 22, 21, 14, 15, 23, 28, 35, 52, 64, 48, 17, 4, 7, 9, 10, 15, 22, 21, 14, 15, 23, 28, 35, 52, 64, 49, 22, 15, 23, 28, 35, 52, 65, 56, 43, 53, 74, 91, 122, 168, 176, 112, 33, 4, 7, 9, 10, 15, 22, 21, 14, 15, 23, 28, 35, 52
Offset: 0

Views

Author

Omar E. Pol, Dec 16 2008, Dec 19 2008, Jan 02 2009

Keywords

Comments

Rows of A152978 when written as a triangle converge to this sequence. - Omar E. Pol, Jul 19 2009

Examples

			Triangle begins:
.1;
.2;
.3,3;
.4,7,8,5;
.4,7,9,10,15,22,20,9;
.4,7,9,10,15,22,21,14,15,23,28,35,52,64,48,17;
....
Rows converge to A153001. - _N. J. A. Sloane_, Jun 07 2009
		

Crossrefs

Equals A151688 divided by 2. - N. J. A. Sloane, Jun 03 2009
For generating functions of the form Product_{k>=c} (1+a*x^(2^k-1)+b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Equals A147646/4. - N. J. A. Sloane, May 01 2009

Programs

  • Maple
    Maple code from N. J. A. Sloane, May 18 2009. First define old version with offset 1:
    S:=proc(n) option remember; local i,j;
    if n <= 0 then RETURN(0); fi;
    if n <= 2 then RETURN(2^(n-1)); fi;
    i:=floor(log(n)/log(2));
    j:=n-2^i;
    if j=0 then RETURN(n/2+1); fi;
    if j<2^i-1 then RETURN(2*S(j)+S(j+1)); fi;
    if j=2^i-1 then RETURN(2*S(j)+S(j+1)-1); fi;
    -1;
    end;
    # Now change the offset:
    T:=n->S(n+1);
    G := (1 + x) * mul(1 + x^(2^k-1) + 2*x^(2^k),k=1..20);
  • Mathematica
    nmax = 78;
    G = x*((1 + x)/(1 - x)) * Product[ (1 + x^(2^n - 1) + 2*x^(2^n)), {n, 1, Log2[nmax] // Ceiling}];
    CoefficientList[G + O[x]^nmax, x] // Differences (* Jean-François Alcover, Jul 21 2022 *)

Formula

G.f.: (1 + x) * Prod_{ n >= 1} (1 + x^(2^n-1) + 2*x^(2^n)). - N. J. A. Sloane, May 20 2009, corrected May 21 2009
For formula see A147646 (or, better, see the Maple code below).

Extensions

More terms (based on A147646) from N. J. A. Sloane, May 01 2009
Offset changed by N. J. A. Sloane, May 18 2009

A151552 G.f.: Product_{k>=1} (1 + x^(2^k-1) + x^(2^k)).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 19 2009, Dec 26 2009

Keywords

Examples

			Written as a triangle:
1;
1;
1,1;
2,2,1,1;
2,2,2,3,4,3,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,2,3,4,4,5,7,7,5,5,7,8,9,12,14,11,5,1,1;
2,2,2,3,4,3,2,3,4,4,5,7,7,4,2,3,4,4,5,7,7,5,5,7,8,9,12,14,11,5,2,3,4,4,5,7,7,5,5,...
The rows converge to A151714.
		

Crossrefs

For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.

Programs

  • Maple
    G := mul( 1 + x^(2^n-1) + x^(2^n), n=1..20);
    wt := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
    f:=proc(n) local t1,k; global wt; t1:=0; for k from 0 to 20 do if n+k mod 2 = 0 then t1:=t1+binomial(wt(n+k),k); fi; od; t1; end;
  • Mathematica
    a[n_] := Sum[If[EvenQ[n + k], Binomial[DigitCount[n + k, 2, 1], k], 0], {k, 0, Floor[Log2[n + 1]]}]; Array[a, 100, 0] (* Amiram Eldar, Jul 29 2023 *)

Formula

a(n) = 1 for 0 <= n <= 3; thereafter write n = 2^i + j, with 0 <= j < 2^i, then a(n) = a(j) + a(j+1), except that a(2^(i+1)-2) = a(2^(i+1)-1) = 1.
a(n) = Sum_{k>=0, n+k even} binomial(A000120(n+k),k); the sum may be restricted further to k <= A000523(n+1). - Hagen von Eitzen, May 20 2009 [corrected by Amiram Eldar, Jul 29 2023]

A160573 G.f.: Product_{k >= 0} (1 + x^(2^k-1) + x^(2^k)).

Original entry on oeis.org

2, 3, 3, 3, 5, 6, 4, 3, 5, 6, 6, 8, 11, 10, 5, 3, 5, 6, 6, 8, 11, 10, 7, 8, 11, 12, 14, 19, 21, 15, 6, 3, 5, 6, 6, 8, 11, 10, 7, 8, 11, 12, 14, 19, 21, 15, 8, 8, 11, 12, 14, 19, 21, 17, 15, 19, 23, 26, 33, 40, 36, 21, 7, 3, 5, 6, 6, 8, 11, 10, 7, 8, 11, 12, 14, 19, 21, 15, 8, 8
Offset: 0

Views

Author

Hagen von Eitzen, May 20 2009

Keywords

Comments

Sequence mentioned in the Applegate-Pol-Sloane article; see Section 9, "explicit formulas." - Omar E. Pol, Sep 20 2011

Examples

			a(5) = binomial(2,0) + binomial(2,1) + binomial(3,2) + binomial(1,3) + binomial(2,4) + binomial(2,5) + ... = 1 + 2 + 3 + 0 + 0 + 0 + ... = 6
From _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
2;
3;3;
3,5,6,4;
3,5,6,6,8,11,10,5;
3,5,6,6,8,11,10,7,8,11,12,14,19,21,15,6;
3,5,6,6,8,11,10,7,8,11,12,14,19,21,15,8,8,11,12,14,19,21,17,15,19,23,26,...
(End)
		

References

  • D. Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191

Crossrefs

For generating functions of the form Product_{k>=c} (1+a*x^(2^k-1)+b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Row sums of A151683. See A151687 for another version.
Cf. A151552 (g.f. has one factor fewer).
Limiting form of rows of A118977 when that sequence is written as a triangle and the initial 1 is omitted. - N. J. A. Sloane, Jun 01 2009
Cf. A139250, A139251. - Omar E. Pol, Sep 20 2011

Programs

  • Maple
    See A118977 for Maple code.
  • Mathematica
    max = 80; Product[1 + x^(2^k - 1) + x^(2^k), {k, 0, Ceiling[Log[2, max]]}] + O[x]^max // CoefficientList[#, x]& (* Jean-François Alcover, Nov 10 2016 *)

Formula

a(n) = Sum_{i >= 0} binomial(A000120(n+i),i).
For k >= 1, a(2^k-2) = k+1 and a(2^k-1) = 3; otherwise if n = 2^i + j, 0 <= j <= 2^i-3, a(n) = a(j) + a(j+1).
a(n) = 2*A151552(n) + A151552(n-1).

A151688 G.f.: Product_{n>=0} (1 + x^(2^n-1) + 2*x^(2^n)).

Original entry on oeis.org

2, 4, 6, 6, 8, 14, 16, 10, 8, 14, 18, 20, 30, 44, 40, 18, 8, 14, 18, 20, 30, 44, 42, 28, 30, 46, 56, 70, 104, 128, 96, 34, 8, 14, 18, 20, 30, 44, 42, 28, 30, 46, 56, 70, 104, 128, 98, 44, 30, 46, 56, 70, 104, 130, 112, 86, 106, 148, 182, 244, 336, 352, 224, 66, 8, 14, 18, 20, 30, 44
Offset: 0

Views

Author

Omar E. Pol, May 02 2009

Keywords

Comments

This is essentially the same g.f. as A151550 but with the n=0 term included.

Examples

			If written as a triangle, begins:
  2;
  4;
  6, 6;
  8, 14, 16, 10;
  8, 14, 18, 20, 30, 44, 40, 18;
  8, 14, 18, 20, 30, 44, 42, 28, 30, 46, 56, 70, 104, 128, 96, 34;
  ...
		

Crossrefs

Equals 2*A152980 = A147646/2.
Equals limit of rows of triangle in A152968.
For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.

Programs

  • Mathematica
    terms = 70; CoefficientList[Product[(1+x^(2^n-1) + 2 x^(2^n)), {n, 0, Log[2, terms] // Ceiling}] + O[x]^terms, x] (* Stefano Spezia, Sep 02 2025 *)

Formula

a(n) = Sum_{k>=0} 2^(wt(n+k)-k)*binomial(wt(n+k),k).

Extensions

Edited by N. J. A. Sloane, Jun 03 2009, Jul 14 2009

A151685 a(n) = Sum_{k >= 0} bin2(wt(n+k),k+1), where bin2(i,j) = A013609(i,j), wt(i) = A000120(i).

Original entry on oeis.org

3, 7, 5, 7, 17, 17, 7, 7, 17, 17, 19, 41, 51, 31, 9, 7, 17, 17, 19, 41, 51, 31, 21, 41, 51, 55, 101, 143, 113, 49, 11, 7, 17, 17, 19, 41, 51, 31, 21, 41, 51, 55, 101, 143, 113, 49, 23, 41, 51, 55, 101, 143, 113, 73, 103, 143, 161, 257, 387, 369, 211, 71, 13, 7, 17, 17, 19, 41, 51
Offset: 0

Views

Author

N. J. A. Sloane, Jun 01 2009

Keywords

Comments

Or, a(n) = Sum_{k >= 0} 2^wt(k) * binomial(wt(n+k),k).

Examples

			Contribution from _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
.3;
.7,5;
.7,17,17,7;
.7,17,17,19,41,51,31,9;
.7,17,17,19,41,51,31,21,41,51,55,101,143,113,49,11;
.7,17,17,19,41,51,31,21,41,51,55,101,143,113,49,23,41,51,55,101,143,113,...
(End)
		

Crossrefs

For generating functions of the form Product_{k>=c} (1+a*x^(2^k-1)+b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Cf. A000079. - Omar E. Pol, Jun 09 2009

Programs

  • Maple
    bin2:=proc(n,k) option remember; if k<0 or k>n then 0
    elif k=0 then 1 else 2*bin2(n-1,k-1)+bin2(n-1,k); fi; end;
    wt := proc(n) local w,m,i;
    w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
    f:=n->add( bin2(wt(n+k),k),k=0..120 );
    # or:
    f := n->add( 2^k*binomial(wt(n+k),k),k=0..20 );
  • Mathematica
    max = 70; (* number of terms *)
    CoefficientList[Product[1 + 2*x^(2^k-1) + x^(2^k), {k, 0, Log2[max+1] // Ceiling}] + O[x]^max, x] (* Jean-François Alcover, Aug 03 2022 *)

Formula

G.f.: Product_{ k >= 0 } (1 + 2*x^(2^k-1) + x^(2^k)).

A151691 G.f.: Product_{k>=1} (1 + 2*x^(2^k-1) + x^(2^k)).

Original entry on oeis.org

1, 2, 1, 2, 5, 4, 1, 2, 5, 4, 5, 12, 13, 6, 1, 2, 5, 4, 5, 12, 13, 6, 5, 12, 13, 14, 29, 38, 25, 8, 1, 2, 5, 4, 5, 12, 13, 6, 5, 12, 13, 14, 29, 38, 25, 8, 5, 12, 13, 14, 29, 38, 25, 16, 29, 38, 41, 72, 105, 88, 41, 10, 1, 2, 5, 4, 5, 12, 13, 6, 5, 12, 13, 14, 29, 38, 25, 8, 5, 12, 13, 14, 29
Offset: 0

Views

Author

N. J. A. Sloane, Jun 04 2009

Keywords

Examples

			From _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
  1;
  2,1;
  2,5,4,1;
  2,5,4,5,12,13,6,1;
  2,5,4,5,12,13,6,5,12,13,14,29,38,25,8,1;
  2,5,4,5,12,13,6,5,12,13,14,29,38,25,8,5,12,13,14,29,38,25,16,29,38,41,72,...
(End)
		

Crossrefs

For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Cf. A151685. See A151703 for another version with a simpler recurrence.
Cf. A000079. - Omar E. Pol, Jun 09 2009

A151692 G.f.: Product_{k>=2} (1 + x^(2^k-1) + x^(2^k)).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 04 2009

Keywords

Examples

			From _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
  1;
  0,0;
  1,1,0,0;
  1,1,0,1,2,1,0,0;
  1,1,0,1,2,1,0,1,2,1,1,3,3,1,0,0;
  1,1,0,1,2,1,0,1,2,1,1,3,3,1,0,1,2,1,1,3,3,1,1,3,3,2,4,6,4,1,0,0;
  1,1,0,1,2,1,0,1,2,1,1,3,3,1,0,1,2,1,1,3,3,1,1,3,3,2,4,6,4,1,0,1,2,1,1,3,3,...
(End)
		

Crossrefs

For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Cf. A000079. - Omar E. Pol, Jun 09 2009

A151693 G.f.: Product_{k>=0} (1 + 2*x^(2^k-1) + 2*x^(2^k)).

Original entry on oeis.org

3, 8, 10, 10, 22, 36, 28, 14, 22, 36, 40, 64, 116, 128, 72, 22, 22, 36, 40, 64, 116, 128, 84, 72, 116, 152, 208, 360, 488, 400, 176, 38, 22, 36, 40, 64, 116, 128, 84, 72, 116, 152, 208, 360, 488, 400, 188, 88, 116, 152, 208, 360, 488, 424, 312, 376, 536, 720, 1136, 1696, 1776
Offset: 0

Views

Author

N. J. A. Sloane, Jun 04 2009

Keywords

Examples

			From _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
   3;
   8,10;
  10,22,36,28;
  14,22,36,40,64,116,128,72;
  22,22,36,40,64,116,128,84,72,116,152,208,360,488,400,176;
  38,22,36,40,64,116,128,84,72,116,152,208,360,488,400,188,88,116,152,208,...
(End)
		

Crossrefs

For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Cf. A000079. - Omar E. Pol, Jun 09 2009

A151694 G.f.: Product_{k>=1} (1 + 2*x^(2^k-1) + 2*x^(2^k)).

Original entry on oeis.org

1, 2, 2, 2, 6, 8, 4, 2, 6, 8, 8, 16, 28, 24, 8, 2, 6, 8, 8, 16, 28, 24, 12, 16, 28, 32, 48, 88, 104, 64, 16, 2, 6, 8, 8, 16, 28, 24, 12, 16, 28, 32, 48, 88, 104, 64, 20, 16, 28, 32, 48, 88, 104, 72, 56, 88, 120, 160, 272, 384, 336, 160, 32, 2, 6, 8, 8, 16, 28, 24, 12, 16, 28, 32, 48, 88
Offset: 0

Views

Author

N. J. A. Sloane, Jun 04 2009

Keywords

Examples

			From _Omar E. Pol_, Jun 09 2009: (Start)
Triangle begins:
  1;
  2,2;
  2,6,8,4;
  2,6,8,8,16,28,24,8;
  2,6,8,8,16,28,24,12,16,28,32,48,88,104,64,16;
  2,6,8,8,16,28,24,12,16,28,32,48,88,104,64,20,16,28,32,48,88,104,72,56,88,...
(End)
		

Crossrefs

For generating functions of the form Product_{k>=c} (1 + a*x^(2^k-1) + b*x^2^k) for the following values of (a,b,c) see: (1,1,0) A160573, (1,1,1) A151552, (1,1,2) A151692, (2,1,0) A151685, (2,1,1) A151691, (1,2,0) A151688 and A152980, (1,2,1) A151550, (2,2,0) A151693, (2,2,1) A151694.
Cf. A000079. - Omar E. Pol, Jun 09 2009

Programs

  • Mathematica
    CoefficientList[Series[Product[1+2x^(2^k-1)+2x^2^k,{k,10}],{x,0,80}],x] (* Harvey P. Dale, Oct 07 2020 *)
Showing 1-10 of 15 results. Next