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-8 of 8 results.

A007040 Number of (marked) cyclic n-bit binary strings containing no runs of length > 2.

Original entry on oeis.org

2, 2, 6, 6, 10, 20, 28, 46, 78, 122, 198, 324, 520, 842, 1366, 2206, 3570, 5780, 9348, 15126, 24478, 39602, 64078, 103684, 167760, 271442, 439206, 710646, 1149850, 1860500, 3010348, 4870846, 7881198, 12752042, 20633238, 33385284, 54018520
Offset: 1

Views

Author

Keywords

Comments

For n >= 3, also the number of maximal independent vertex sets (and minimal vertex covers) in the n-prism graph. - Eric W. Weisstein, Mar 30 and Aug 07 2017
From Petros Hadjicostas, Jul 08 2018: (Start)
Let q and m be positive integers. We denote by f1(m,q,n) the number of (marked) cyclic q-ary strings of length n that contain no runs of lengths > m when no wrapping around is allowed, and by f2(m,q,n) when wrapping around is allowed.
It is clear that f1(m,q,n) = f2(m,q,n) for n > m, but f1(m,q,n) = q^n and f2(m,q,n) = q^n - q when 1 <= n <= m.
Burstein and Wilf (1997) and Edlin and Zeilberger (2000) considered f1(m,q,n) while Hadjicostas and Zhang considered f2(m,q,n).
Let g(m, q, x) = (m+1-m*q*x)/(1-q*x+(q-1)*x^(m+1)) - (m+1)/(1-x^(m+1)).
By generalizing Moser (1991, 1993), Burstein and Wilf (1997) proved that the g.f. of the numbers f1(m,q,n) is F1(m,q,x) = ((1-x^m)/(1-x))*(q*x + (q-1)*x* g(m, q, x)).
Using the above formula by Burstein and Wilf (1997), Hadjicostas and Zhang (2018) proved that the g.f. of the numbers f2(m,q,n) is F2(m,q,x) = ((q-1)*x*(1-x^m)/(1-x))*g(m, q, x).
A necklace is an unmarked cyclic string. If f3(m,q,n) is the number of q-ary necklaces of length n with no runs of length > m (and wrapping around is allowed), then f3(m,q,n) = (1/n)*Sum_{d|n} phi(n/d)*f2(m,q,d), where phi(.) is Euler's totient function. Using this formula and F2(m,q,x), Hadjicostas and Zhang (2018) proved that the g.f. of the numbers f3(m,q,n) is given by F3(m,q,x) = -(q-1)*x*(1-x^m)/((1-x)*(1-x^(m+1))) - Sum_{s>=1} (phi(s)/s)*log(1 - (q-1)*(x^s - x^(s*(m+1)))/(1-x^s)).
For the current sequence, we have q = 2 and m = 2. We have a(n) = f1(m=2, q=2, n) = f2(m=2, q=2, n) for n >= 3, but for a(1) and a(2) it is unclear what approach the author of the sequence is following. He has a(1) = q^1 = 2, but a(2) = q^2 - q = 2^2 - 2 = 2. (Note that, for q = m = 2, we have f1(m=2, q=2, 1) = 2, f1(m=2, q=2, 2) = 4, f2(m=2, q=2, 1) = 0, and f2(m=2, q=2, 2) = 2.)
If A(x) is the g.f. of the current sequence, we have A(x) = F1(m=2,q=2, x) - 2*x^2 = F2(m=2, q=2, x) + 2*x.
When m = 1 and q = 3, we have f1(m=1, q=3, n) = number of marked cyclic words on three letters with no two consecutive like letters. We have f1(m=1, q=3, n) = A092297(n) for n >= 2. This was first stated in the comments of that sequence by G. Critzer.
When m = 1 and q = 4, we have f1(m=1, q=4, n) = number of marked cyclic words on four letters with no two consecutive like letters. We have f1(m=1, q=4, n) = A218034(n) for n >= 1. This was first stated in the comments of that sequence by J. Arndt.
A generalization of the above formula by Burstein and Wilf (1997) was given by Taylor (2014) in Section 5 of his paper. (End)

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Join[{2}, LinearRecurrence[{0, 1, 2, 1}, {2, 6, 6, 10}, 40]] (* Harvey P. Dale, Nov 09 2011 *)
    Join[{2}, Table[n Sum[Binomial[2 k, n - 2 k]/k, {k, n}], {n, 2, 40}]] (* Harvey P. Dale, Nov 09 2011 *)
    Table[LucasL[n] + 2 Cos[2 n Pi/3], {n, 20}] (* Eric W. Weisstein, Mar 30 2017 *)
  • PARI
    a(n)=if(n<3,2,([0,1,0,0; 0,0,1,0; 0,0,0,1; 1,2,1,0]^(n-2)*[2;6;6;10])[1,1]) \\ Charles R Greathouse IV, Jun 15 2015

Formula

a(n) = a(n-2) + 2*a(n-3) + a(n-4), n >= 7. - David W. Wilson
a(n) = n*Sum_{k=1..n} binomial(2*k, n-2*k)/k for n > 1 with a(0) = 0 and a(1) = 2. - Vladimir Kruchinin, Oct 12 2011
G.f.: 2*x*(1 + x + 2*x^2 - x^4)/((1 - x - x^2)*(1 + x + x^2)). - Colin Barker, Mar 15 2012
a(n) = A000032(n) + 2*cos(2*Pi*n/3) for n > 1. - Eric W. Weisstein, Mar 30 2017
a(n) = 2*A100886(n-1), n > 1. - R. J. Mathar, Jan 20 2018
a(n) = A000032(n) - A061347(n) for n > 1. - Wojciech Florek, Feb 18 2018

Extensions

Name clarified by Petros Hadjicostas, Jul 08 2018

A263656 Number of length-2n central circular binary strings without zigzags (see reference for precise definition).

Original entry on oeis.org

0, 0, 4, 6, 12, 30, 70, 168, 412, 1014, 2514, 6270, 15702, 39468, 99516, 251586, 637500, 1618638, 4117102, 10488684, 26758762, 68354250, 174810354, 447533586, 1146836662, 2941443180, 7550434480, 19395863358, 49859516292, 128252962434, 330101861850
Offset: 0

Views

Author

Felix Fröhlich, Oct 23 2015

Keywords

Comments

See page 6 in the reference.
A zigzag is a substring which is either 010 or 101. The central binary strings are those that contain an equal number of 0's and 1's.

Examples

			For n=3 the 6 strings are 000111, 001110, 011100, 111000, 110001, 100011.
		

Crossrefs

Main diagonal of A263655.

Programs

  • Mathematica
    a[n_ /; n < 6] := {0, 0, 4, 6, 12, 30}[[n + 1]]; a[n_] := a[n] = (-(3*(n - 6)*a[n - 6]) + (7*n - 37)*a[n - 5] - 6*a[n - 4] + (7*n - 27)*a[n - 3] - 4*(n - 4)*a[n - 2] + 3*(n - 1)*a[n - 1])/n;
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Oct 08 2017, after Andrew Howroyd *)

Formula

a(n) = (1/n)*(3*(n-1)*a(n-1) - 4*(n-4)*a(n-2) + (7*n-27)*a(n-3) - 6*a(n-4) + (7*n-37)*a(n-5) - 3*(n-6)*a(n-6)) for n >= 6. - Andrew Howroyd, Feb 26 2017

Extensions

corrected a(1) and a(17)-a(30) from Andrew Howroyd, Feb 26 2017

A263655 Table T(m, n) of number of circular binary strings with m ones and n zeros without zigzags, read by antidiagonals (see reference for precise definition).

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 4, 0, 1, 1, 0, 5, 5, 0, 1, 1, 0, 6, 6, 6, 0, 1, 1, 0, 7, 7, 7, 7, 0, 1, 1, 0, 8, 8, 12, 8, 8, 0, 1, 1, 0, 9, 9, 18, 18, 9, 9, 0, 1, 1, 0, 10, 10, 25, 30, 25, 10, 10, 0, 1, 1, 0, 11, 11, 33, 44, 44, 33, 11, 11, 0, 1
Offset: 0

Views

Author

Felix Fröhlich, Oct 23 2015

Keywords

Comments

See page 5, figure 1 in the reference.
A zigzag is a substring which is either 010 or 101.

Examples

			Table starts:
0 1  1  1  1   1   1   1   1    1    1    1    1 ...
1 0  0  0  0   0   0   0   0    0    0    0    0 ...
1 0  4  5  6   7   8   9  10   11   12   13   14 ...
1 0  5  6  7   8   9  10  11   12   13   14   15 ...
1 0  6  7 12  18  25  33  42   52   63   75   88 ...
1 0  7  8 18  30  44  60  78   98  120  144  170 ...
1 0  8  9 25  44  70 104 147  200  264  340  429 ...
1 0  9 10 33  60 104 168 255  368  510  684  893 ...
1 0 10 11 42  78 147 255 412  629  918 1292 1765 ...
1 0 11 12 52  98 200 368 629 1014 1558 2300 3283 ...
1 0 12 13 63 120 264 510 918 1558 2514 3885 5786 ...
		

Crossrefs

Main diagonal is A263656. Antidiagonal sums are A007039.

Programs

  • Mathematica
    max = 11;
    U[r_, k_] := Binomial[r - k + 2*Floor[k/3], Floor[k/3]];
    V[r_, k_] := Binomial[r - Ceiling[k/2] - 1, Floor[k/2]];
    T[0, 0] = T[1, 1] = 0;
    T[0, ] = T[, 0] = 1;
    T[n_ /; n >= 2, m_] /; m <= n := T[n, m] = Switch[m, 1, 0, 2, n + 2, 3, n + 3, _, Sum[ U[m, k]*U[n, k] - 2*V[m, k]*V[n, k]*(-1)^k, {k, 0, max-3}]];
    T[n_, m_] /; m > n := T[m, n];
    Table[T[n - k, k], {n, 0, max}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 01 2018, after Andrew Howroyd *)

Formula

From Andrew Howroyd, Feb 26 2017: (Start)
T(n,m) = Sum_{k>=0} U(m,k)*U(n,k) - 2*V(m,k)*V(n,k)*(-1)^k
where U(r,k)=binomial(r-k+2*floor(k/3), floor(k/3)), V(r,k)=binomial(r-ceiling(k/2)-1, floor(k/2)).
T(n,0)=1 for n>=1, T(n,1)=0 for n>=1, T(n,2)=n+2 for n>=2, T(n,3)=n+3 for n>=2.
T(n,4)=(n-1)*(n+4)/2 for n>=3, T(n,5)=(n-2)*(n+5) for n>=3. (End)

Extensions

a(66)-a(77) from Andrew Howroyd, Feb 26 2017

A263657 Table T(m, n) of number of (0, 1)-necklaces without zigzags with m 1's and n 0's, read by antidiagonals (see reference for precise definition).

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 1, 0, 1, 1, 3, 3, 3, 1, 1, 0, 1, 1, 0, 1, 1, 3, 4, 4, 3, 1, 1, 0, 1, 1, 0, 1, 1, 4, 5, 7, 5, 4, 1, 1, 0, 1
Offset: 0

Views

Author

Felix Fröhlich, Oct 23 2015

Keywords

Comments

See figure 2 on page 16 in the reference.
A zigzag is a substring which is either 010 or 101. The necklaces 01 and 10 are considered zigzags. Necklaces do not allow turnover.

Examples

			Table starts:
0 1 1 1 1  1  1  1   1   1   1    1    1    1    1    1 ...
1 0 0 0 0  0  0  0   0   0   0    0    0    0    0    0 ...
1 0 1 1 1  1  1  1   1   1   1    1    1    1    1    1 ...
1 0 1 1 1  1  1  1   1   1   1    1    1    1    1    1 ...
1 0 1 1 2  2  3  3   4   4   5    5    6    6    7    7 ...
1 0 1 1 2  3  4  5   6   7   8    9   10   11   12   13 ...
1 0 1 1 3  4  7  8  11  14  17   20   25   28   33   38 ...
1 0 1 1 3  5  8 12  17  23  30   38   47   57   68   80 ...
1 0 1 1 4  6 11 17  27  37  52   68   90  112  141  171 ...
1 0 1 1 4  7 14 23  37  57  82  115  157  207  268  341 ...
1 0 1 1 5  8 17 30  52  82 128  185  265  363  491  644 ...
1 0 1 1 5  9 20 38  68 115 185  285  423  608  850 1160 ...
		

Crossrefs

Main diagonal is A263658. Antidiagonal sums are A263659.

Extensions

a(45)-a(90) from Andrew Howroyd, Feb 26 2017

A263658 Number of (0, 1)-necklaces with n zeros and n ones without zigzags (see reference for precise definition).

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 7, 12, 27, 57, 128, 285, 659, 1518, 3561, 8389, 19936, 47607, 114397, 276018, 669035, 1627491, 3973106, 9728991, 23892779, 58828866, 145201423, 359182693, 890350290, 2211257973, 5501701981, 13711368630, 34225162345, 85555609119, 214166692430, 536810116905
Offset: 0

Views

Author

Felix Fröhlich, Oct 23 2015

Keywords

Comments

See page 16 in the reference.
A zigzag is a substring which is either 010 or 101. The necklaces 01 and 10 are considered to be with a zigzag. Necklaces do not allow turnover.

Examples

			For n=2 the necklace is 0011.
For n=3 the necklace is 000111.
For n=4 the necklaces are 00001111, 00110011.
For n=5 the necklaces are 0000011111, 0001110011, 0001100111.
		

Crossrefs

Main diagonal of A263657.

Programs

  • Mathematica
    (* b = A263656 *)
    b[n_ /; n < 6] := {0, 0, 4, 6, 12, 30}[[n + 1]];
    b[n_] := b[n] = (1/n)*(3*(n - 1)*b[n - 1] - 4*(n - 4)*b[n - 2] + (7*n - 27)*b[n - 3] - 6*b[n - 4] + (7*n - 37)*b[n - 5] - 3*(n - 6)*b[n - 6]);
    a[0] = 0;
    a[n_] := (1/n)*DivisorSum[n, EulerPhi[n/#] * b[#]/2&];
    Array[a, 36, 0] (* Jean-François Alcover, Sep 11 2017, after Andrew Howroyd *)

Formula

a(n) = (1/n) * Sum_{d | n} totient(n/d) * A263656(d) / 2. - Andrew Howroyd, Feb 26 2017

Extensions

Offset corrected and a(21)-a(35) from Andrew Howroyd, Feb 26 2017

A263659 Number of (0, 1)-necklaces of length n without zigzags (see reference for precise definition).

Original entry on oeis.org

0, 2, 2, 2, 3, 4, 5, 6, 8, 10, 15, 20, 31, 42, 64, 94, 143, 212, 329, 494, 766, 1170, 1811, 2788, 4341, 6714, 10462, 16274, 25415, 39652, 62075, 97110, 152288, 238838, 375167, 589528, 927555, 1459962, 2300348, 3626242, 5721045
Offset: 0

Views

Author

Felix Fröhlich, Oct 23 2015

Keywords

Comments

See page 16 in the reference.
A zigzag is a substring which is either 010 or 101. The necklaces 01 and 10 are considered to be with a zigzag. Necklaces do not allow turnover.

Examples

			For n=5 the necklaces are 00000, 11111, 00011, 00111 so a(5)=4.
		

Crossrefs

Antidiagonal sums of A263657.

Programs

  • Mathematica
    (* b = A007039 *) b[n_ /; n<4] = 2; b[4] = 6; b[n_] := b[n] = 2*b[n-1] - b[n-2] + b[n-4];
    a[0] = 0; a[n_] := (1/n) * DivisorSum[n, EulerPhi[n/#] * b[#]&];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 08 2017, after Andrew Howroyd *)

Formula

a(n) = (1/n) * Sum_{d | n} totient(n/d) * A007039(d). - Andrew Howroyd, Feb 26 2017

Extensions

a(25)-a(40) from Andrew Howroyd, Feb 26 2017

A111734 Expansion of (1-x)*(2*x^2+2*x+1) / ((x^2-x-1)*(x^2+x+1)).

Original entry on oeis.org

-1, 1, -1, 3, -6, 10, -15, 23, -37, 61, -100, 162, -261, 421, -681, 1103, -1786, 2890, -4675, 7563, -12237, 19801, -32040, 51842, -83881, 135721, -219601, 355323, -574926, 930250, -1505175, 2435423, -3940597, 6376021, -10316620, 16692642, -27009261, 43701901, -70711161, 114413063
Offset: 1

Views

Author

Creighton Dement, Nov 18 2005

Keywords

Comments

Floretion Algebra Multiplication Program, FAMP Code: 2tesseq[(.5'j + .5'k + .5j' + .5k' + .5'ij' - .5'ik' + .5'ji' + .5'ki')*(.5'i + .5'j + .5'k + .5e)]

References

  • Creighton Dement, Floretion Integer Sequences (work in progress).

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1-x)(2x^2+2x+1)/((x^2-x-1)(x^2+x+1)),{x,0,60}],x] (* or *) LinearRecurrence[{-2,-1,0,1},{-1,1,-1,3},60] (* Harvey P. Dale, Sep 01 2021 *)
  • PARI
    Vec(-x*(1 - x)*(1 + 2*x + 2*x^2) / ((1 + x - x^2)*(1 + x + x^2)) + O(x^40)) \\ Colin Barker, May 18 2019

Formula

a(n) = ((-1)^n/2)*A007039(n); a(n) + a(n+1) + a(n+2) = ((-1)^n)*A000204(n).
a(n) = (-1)^n*(n*sum((binomial(n-2*m,2*m))/(n-2*m),m,0,floor((n-1)/2))). - Vladimir Kruchinin, Mar 10 2013
a(n) = -2*a(n-1) - a(n-2) + a(n-4) for n>4. - Colin Barker, May 18 2019
E.g.f.: exp(-x/2)*(cos(sqrt(3)*x/2) + cosh(sqrt(5)*x/2) + sqrt(3)*sin(sqrt(3)*x/2) - sqrt(5)*sinh(sqrt(5)*x/2))/2. - Stefano Spezia, Aug 03 2022

A381813 Number of connected components, not counting isolated vertices, of the blet graph for n coins.

Original entry on oeis.org

3, 2, 1, 7, 2, 5, 8, 8, 6, 50, 12, 30, 61, 62, 47, 417, 102, 303, 682, 696, 532, 4904, 1250, 3854, 8911, 9218, 7147, 66735, 17298, 53965, 126348, 131740, 103080
Offset: 3

Views

Author

Pontus von Brömssen, Mar 08 2025

Keywords

Comments

The blet graph for n coins has one vertex for each binary heads/tails-sequence of length n. Two vertices are connected by an edge if there is a legal move between them in the game of blet, i.e., if one can be obtained from the other by replacing one occurrence of a triple THT with HTH. The binary sequences are circularly connected, so such a triple is allowed to start at one of the last two elements of the sequence and continue from the beginning.
The number of isolated vertices is A007039(n).
A075273(n) is the size of the component containing (HT)^n in the blet graph for 2*n coins.

Examples

			For n = 4, the blet graph has A007039(4) = 6 isolated vertices TTTT, TTHH, THHT, HTTH, HHTT, HHHH, and a(4) = 2 components of size at least 2: {TTTH, THTT, THHH, HTHT, HHTH} and {TTHT, THTH, HTTT, HTHH, HHHT}.
		

Crossrefs

Cf. A007039, A075273, A381812, A381814 (size of the largest component).

Programs

  • Python
    # see linked program

Extensions

a(24)-a(28) from Michael S. Branicky, Mar 08 2025
a(29)-a(30) from Michael S. Branicky, Mar 12 2025
a(31)-a(35) from Bert Dobbelaere, Mar 16 2025
Showing 1-8 of 8 results.