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.

A000358 Number of binary necklaces of length n with no subsequence 00, excluding the necklace "0".

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 5, 8, 10, 15, 19, 31, 41, 64, 94, 143, 211, 329, 493, 766, 1170, 1811, 2787, 4341, 6713, 10462, 16274, 25415, 39651, 62075, 97109, 152288, 238838, 375167, 589527, 927555, 1459961, 2300348, 3626242, 5721045, 9030451, 14264309, 22542397, 35646312, 56393862, 89264835, 141358275
Offset: 1

Views

Author

Keywords

Comments

a(n) is also the number of inequivalent compositions of n into parts 1 and 2 where two compositions are considered to be equivalent if one is a cyclic rotation of the other. a(6)=5 because we have: 2+2+2, 2+2+1+1, 2+1+2+1, 2+1+1+1+1, 1+1+1+1+1+1. - Geoffrey Critzer, Feb 01 2014
Moebius transform is A006206. - Michael Somos, Jun 02 2019

Examples

			G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 5*x^6 + 5*x^7 + 8*x^8 + 10*x^9 + ... - _Michael Somos_, Jun 02 2019
Binary necklaces are: 1; 01, 11; 011, 111; 0101, 0111, 1111; 01010, 01011, 01111. - _Michael Somos_, Jun 02 2019
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 499.
  • T. Helleseth and A. Kholosha, Bent functions and their connections to combinatorics, in Surveys in Combinatorics 2013, edited by Simon R. Blackburn, Stefanie Gerke, Mark Wildon, Camb. Univ. Press, 2013.

Crossrefs

Column k=0 of A320341.

Programs

  • Maple
    A000358 := proc(n) local sum; sum := 0; for d in divisors(n) do sum := sum + phi(n/d)*(fibonacci(d+1)+fibonacci(d-1)) od; RETURN(sum/n); end;
    with(combstruct); spec := {A=Union(zero,Cycle(one),Cycle(Prod(zero,Sequence(one,card>0)))),one=Atom,zero=Atom}; seq(count([A,spec,unlabeled],size=i),i=1..30);
  • Mathematica
    nn=48;Drop[Map[Total,Transpose[Map[PadRight[#,nn]&,Table[ CoefficientList[ Series[CycleIndex[CyclicGroup[n],s]/.Table[s[i]->x^i+x^(2i),{i,1,n}],{x,0,nn}],x],{n,0,nn}]]]],1] (* Geoffrey Critzer, Feb 01 2014 *)
    max = 50; B[x_] := x*(1+x); A = Sum[EulerPhi[k]/k*Log[1/(1-B[x^k])], {k, 1, max}]/x + O[x]^max; CoefficientList[A, x] (* Jean-François Alcover, Feb 08 2016, after Joerg Arndt *)
    Table[1/n * Sum[EulerPhi[n/d] Total@ Map[Fibonacci, d + # & /@ {-1, 1}], {d, Divisors@ n}], {n, 47}] (* Michael De Vlieger, Dec 28 2016 *)
    a[ n_] := If[ n < 1, 0, DivisorSum[n, EulerPhi[n/#] LucasL[#] &]/n]; (* Michael Somos, Jun 02 2019 *)
  • PARI
    N=66;  x='x+O('x^N);
    B(x)=x*(1+x);
    A=sum(k=1, N, eulerphi(k)/k*log(1/(1-B(x^k))));
    Vec(A)
    /* Joerg Arndt, Aug 06 2012 */
    
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, eulerphi(n/d) * (fibonacci(d+1) + fibonacci(d-1)))/n)}; /* Michael Somos, Jun 02 2019 */
    
  • Python
    from sympy import totient, lucas, divisors
    def A000358(n): return (n&1^1)+sum(totient(n//k)*(lucas(k)-((k&1^1)<<1)) for k in divisors(n,generator=True))//n # Chai Wah Wu, Sep 23 2023

Formula

a(n) = (1/n) * Sum_{ d divides n } totient(n/d) [ Fib(d-1)+Fib(d+1) ].
G.f.: Sum_{k>=1} phi(k)/k * log( 1/(1-B(x^k)) ) where B(x)=x*(1+x). - Joerg Arndt, Aug 06 2012
a(n) ~ ((1+sqrt(5))/2)^n / n. - Vaclav Kotesovec, Sep 12 2014
a(n) = Sum_{0 <= i <= ceiling((n-1)/2)} [ (1/(n - i)) * Sum_{d|gcd(i, n-i)} phi(d) * binomial((n - i)/d, i/d) ]. (This is DeFord's formula for the number of distinct Lucas tilings of a 1 X n bracelet up to symmetry, even though in the paper he refers to sequence A032192(n) = a(n) - 1.) - Petros Hadjicostas, Jun 07 2019

A280218 Number of binary necklaces of length n with no subsequence 0000.

Original entry on oeis.org

1, 2, 3, 5, 6, 11, 15, 27, 43, 75, 125, 228, 391, 707, 1262, 2285, 4119, 7525, 13691, 25111, 46033, 84740, 156123, 288529, 533670, 989305, 1835983, 3412885, 6351031, 11834623, 22074821, 41222028, 77048131, 144148859, 269913278, 505826391, 948652695, 1780473001, 3343960175, 6284560319, 11818395345
Offset: 1

Views

Author

Petros Hadjicostas, Dec 29 2016

Keywords

Comments

a(n) is the number of cyclic sequences of length n consisting of zeros and ones that do not contain four consecutive zeros provided we consider as equivalent those sequences that are cyclic shifts of each other.

Examples

			a(5)=6 because we have six binary cyclic sequences of length 5 that avoid four consecutive zeros: 00011, 00101, 00111, 01101, 01111, 11111.
		

Crossrefs

Programs

  • Mathematica
    Table[(1/n) Sum[EulerPhi[n/d] SeriesCoefficient[(4 - 3 x - 2 x^2 - x^3)/(1 - x - x^2 - x^3 - x^4), {x, 0, d}], {d, Divisors@ n}], {n, 41}] (* Michael De Vlieger, Dec 30 2016 *)
  • PARI
    N=44; x='x+O('x^N);
    B(x)=x*(1+x+x^2+x^3);
    Vec(sum(k=1, N, eulerphi(k)/k * log(1/(1-B(x^k))))) \\ Joerg Arndt, Dec 29 2016

Formula

a(n) = (1/n) * Sum_{d divides n} totient(n/d) * A073817(d).
G.f.: Sum_{k>=1} (phi(k)/k) * log(1/(1-B(x^k))) where B(x) = x*(1+x+x^2+x^3).

A351360 Number of binary necklaces with n beads and at least three consecutive black beads.

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 9, 17, 31, 60, 113, 220, 419, 813, 1565, 3033, 5855, 11358, 21977, 42644, 82675, 160517, 311609, 605551, 1176871, 2288964, 4453237, 8669002, 16881859, 32892459, 64112225, 125022545, 243898335, 476011102, 929387453, 1815322932
Offset: 1

Views

Author

Marko Riedel, Feb 08 2022

Keywords

Crossrefs

Formula

a(n) = A000031(n) - A093305(n).

A274017 Number of n-bead binary necklaces (no turning over allowed) that avoid the subsequence 110.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 6, 6, 9, 11, 16, 20, 32, 42, 65, 95, 144, 212, 330, 494, 767, 1171, 1812, 2788, 4342, 6714, 10463, 16275, 25416, 39652, 62076, 97110, 152289, 238839, 375168, 589528, 927556, 1459962, 2300349, 3626243, 5721046, 9030452, 14264310, 22542398, 35646313, 56393863, 89264836, 141358276, 223959712
Offset: 0

Views

Author

Marko Riedel, Jun 06 2016

Keywords

Comments

The pattern in this enumeration must be contiguous (all three values next to each other in one sequence of three letters).
The proofs of all my formulas below become evident once it is realized that A001612(n) gives the number of cyclic sequences of length n consisting of zeros and ones that avoid the pattern 001 (or equivalently, the pattern 110) provided the positions of zeros and ones on a circle are fixed. Everything else follows from the material that can be found in A001612. - Petros Hadjicostas, Jan 11 2017

Examples

			The following necklace
     1-1
    /   \
   0     0
   |     |
   1     1
    \   /
     0-0
contains one instance of the subsequence starting in the upper left corner. Unlike a bracelet, the necklace is oriented.
a(8) = 9: 00000000, 00000001, 00000101, 00001001, 00010001, 00010101, 00100101, 01010101, 11111111.
a(9) = 11: 000000000, 000000001, 000000101, 000001001, 000010001, 000010101, 000100101, 000101001, 001001001, 001010101, 111111111.
		

Crossrefs

Formula

From Petros Hadjicostas, Jan 11 2017: (Start)
For all the formulas below, assume n>=1.
a(n) = 1 + A000358(n). (Notice the different offsets.)
a(n) = 1 + (1/n) * Sum_{d|n} totient(n/d)*(Fibonacci(d-1)+Fibonacci(d+1)).
a(n) = (1/n) * Sum_{d divides n} totient(n/d)*A001612(d).
G.f.: 1/(1-x) + Sum_{k>=1} (phi(k)/k) * log(1/(1-B(x^k))) where B(x) = x*(1+x). (This is a modification of a formula due to Joerg Arndt.)
G.f.: 1 + Sum_{k>=1} (phi(k)/k) * log(1/C(x^k)) where C(x) = (1-x)*(1-B(x)). (End)
a(n) = 1 + (1/n) * Sum_{d|n} A000010(n/d)*A000204(d). [After the second formula above given by Hadjicostas]. - Antti Karttunen, Jan 12 2017

A322057 Array read by upwards antidiagonals: T(i,n) is the number of binary necklaces of length n that avoid 00...0 (i 0's).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 3, 1, 1, 2, 3, 4, 3, 1, 1, 2, 3, 5, 5, 5, 1, 1, 2, 3, 5, 6, 9, 5, 1, 1, 2, 3, 5, 7, 11, 11, 8, 1, 1, 2, 3, 5, 7, 12, 15, 19, 10, 1, 1, 2, 3, 5, 7, 13, 17, 27, 29, 15, 1, 1, 2, 3, 5, 7, 13, 18, 31, 43, 48, 19, 1
Offset: 1

Views

Author

N. J. A. Sloane, Dec 25 2018

Keywords

Comments

T(i,n) is the number of necklace compositions with sum n and parts at most i. For example, the T(3,5) = 5 compositions up to cyclic equivalence are 11111, 1112, 113, 122, 23. - Andrew Howroyd, Jan 08 2024

Examples

			The first few antidiagonals are:
  1;
  1,  1;
  1,  2,  1;
  1,  2,  2,  1;
  1,  2,  3,  3,  1;
  1,  2,  3,  4,  3,  1;
  1,  2,  3,  5,  5,  5,  1;
  1,  2,  3,  5,  6,  9,  5,  1;
  1,  2,  3,  5,  7, 11, 11,  8,  1;
  1,  2,  3,  5,  7, 12, 15, 19, 10,  1;
  ...
From _Petros Hadjicostas_, Jan 16 2019: (Start)
In the above triangle (first few antidiagonals, read upwards), the j-th row corresponds to T(j,1), T(j-1,2), T(j-2,3), ..., T(1,j).
This, however, is not the j-th row of the square array (see the scanned page above).
For example, the sixth row of the square array is as follows:
T(6,1) = 1, T(6,2) = 2, T(6,3) = 3, T(6,4) = 5, T(6, 5) = 7, T(6, 6) = 13, ...
To generate these numbers, we use T(6, n) = (1/n)*Sum_{d|n} phi(n/d)*L(6,d), where
L(6,1) = 1, L(6,2) = 3, L(6,3) = 7, L(6,4) = 15, L(6,5) = 31, L(6,6) = 63, ...
See the sixth row of A125127. See also the Sage program below by Freddy Barrera.
(End)
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 520.

Crossrefs

Rows 2, 3, 4 and 5 are A000358, A093305, A280218, A280303.
The rows converge to A008965.
Cf. A119458.

Programs

  • PARI
    T(i,n) = {my(p=1/(1 - x*(1 - x^i)/(1 - x))); polcoef(sum(d=1, n, eulerphi(d)*log(subst(p + O(x*x^(n\d)), x, x^d))/d), n)} \\ Andrew Howroyd, Jan 08 2024
  • SageMath
    # uses the L method from A125127
    def T(i, n):
        return sum(euler_phi(n//d)*L(i, d) for d in n.divisors()) // n
    [T(i, n) for d in (1..12) for i, n in zip((d..1, step=-1), (1..d))] # Freddy Barrera, Jan 15 2019
    

Formula

T(i,n) = (1/n) * Sum_{d divides n} totient(n/d)*L(i,d), where L(i,d) = A125127(i,d). See Zhang and Hadjicostas link. - Freddy Barrera, Jan 15 2019
G.f. for row i: Sum_{k>=1} (phi(k)/k) * log(1/(1-B(i, x^k))) where B(i, x) = x*(1 + x + x^2 + ... + x^(i-1)). (This is a generalization of Joerg Arndt's formulae for the g.f.'s of rows 2 and 3.) - Petros Hadjicostas, Jan 24 2019

A280303 Number of binary necklaces of length n with no subsequence 00000.

Original entry on oeis.org

1, 2, 3, 5, 7, 12, 17, 31, 51, 91, 155, 287, 505, 930, 1695, 3129, 5759, 10724, 19913, 37239, 69643, 130745, 245715, 463099, 873705, 1651838, 3126707, 5927817, 11251031, 21382558, 40679233, 77475673, 147694719, 281822847, 538213671, 1028714071, 1967728553
Offset: 1

Views

Author

Petros Hadjicostas and Lingyun Zhang, Dec 31 2016

Keywords

Comments

a(n) is the number of cyclic sequences of length n consisting of zeros and ones that do not contain five consecutive zeros provided we consider as equivalent those sequences that are cyclic shifts of each other.

Examples

			a(5)=7 because we have seven binary cyclic sequences (necklaces) of length 5 that avoid five consecutive zeros: 00001, 00011, 00101, 00111, 01101, 01111, 11111.
		

Crossrefs

Formula

a(n) = (1/n) * Sum_{d divides n} totient(n/d) * A074048(d).
G.f.: Sum_{k>=1} (phi(k)/k) * log(1/(1-B(x^k))) where B(x) = x*(1+x+x^2+x^3+x^4).

Extensions

a(34) onwards from Andrew Howroyd, Jan 25 2024

A063686 Triangular array: T(n,k) is the number of binary necklaces (no turning over) of length n whose longest run of 1's has length k. Table begins at n=0, k=0.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 4, 4, 2, 1, 1, 1, 1, 4, 6, 4, 2, 1, 1, 1, 1, 7, 11, 8, 4, 2, 1, 1, 1, 1, 9, 19, 14, 8, 4, 2, 1, 1, 1, 1, 14, 33, 27, 16, 8, 4, 2, 1, 1, 1, 1, 18, 56, 50, 30, 16, 8, 4, 2, 1, 1, 1, 1, 30, 101, 96, 59, 32, 16, 8, 4, 2, 1, 1, 1
Offset: 0

Views

Author

Christopher Lenard (c.lenard(AT)bendigo.latrobe.edu.au), Aug 22 2001

Keywords

Comments

Column k=1 appears to be A032190(n), n=2,3,...

Examples

			Triangle begins:
  1;
  1, 1;
  1, 1, 1;
  1, 1, 1, 1;
  1, 2, 1, 1, 1;
  1, 2, 2, 1, 1, 1;
  1, 4, 4, 2, 1, 1, 1;
  1, 4, 6, 4, 2, 1, 1, 1;
  1, 7, 11, 8, 4, 2, 1, 1, 1;
  1, 9, 19, 14, 8, 4, 2, 1, 1, 1;
  1, 14, 33, 27, 16, 8, 4, 2, 1, 1, 1;
  ...
		

Crossrefs

Cf. A000358, A093305, A280218 (necklaces avoiding 00, 000, 0000).

Programs

  • PARI
    \\ here R(n) is A048887 transposed
    R(n)={Mat(vector(n, k, Col((1-x)/(1-2*x+x^(k+1)) - 1 + O(x*x^n))))}
    S(M)={matrix(#M-1, #M-1, n, k, if(kAndrew Howroyd, Oct 15 2017

Extensions

T(0,0)=1 from Andrew Howroyd, Oct 15 2017

A320286 Expansion of Product_{k>=1} 1/(1 - x^k - x^(2*k) - x^(3*k)).

Original entry on oeis.org

1, 1, 3, 6, 13, 24, 51, 93, 184, 343, 654, 1211, 2286, 4217, 7865, 14521, 26912, 49600, 91669, 168800, 311305, 573058, 1055576, 1942437, 3575840, 6578762, 12106121, 22270404, 40972700, 75367724, 138644224, 255020102, 469095029, 862827347, 1587061299, 2919111935, 5369224903
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 09 2018

Keywords

Crossrefs

Programs

  • Magma
    m:=40; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!(1/( &*[(1-x^k-x^(2*k)-x^(3*k)): k in [1..m+2]]))); // G. C. Greubel, Oct 24 2018
  • Maple
    seq(coeff(series(mul(((1-x^k-x^(2*k)-x^(3*k)))^(-1),k=1..n),x,n+1), x, n), n = 0 .. 40); # Muniru A Asiru, Oct 25 2018
  • Mathematica
    nmax = 36; CoefficientList[Series[Product[1/(1 - x^k - x^(2 k) - x^(3 k)), {k, 1, nmax}], {x, 0, nmax}], x]
    nmax = 36; CoefficientList[Series[Exp[-Sum[Sum[EulerPhi[j] Log[1 - x^(j k) (1 + x^(j k) + x^(2 j k))]/(j k), {j, 1, nmax}], {k, 1, nmax}]], {x, 0, nmax}], x]
  • PARI
    m=40; x='x+O('x^m); Vec(1/prod(k=1, m+2, (1-x^k-x^(2*k)-x^(3*k)))) \\ G. C. Greubel, Oct 24 2018
    

Formula

G.f.: exp(-Sum_{k>=1} Sum_{j>=1} phi(j)*log(1 - x^(j*k)*(1 + x^(j*k) + x^(2*j*k)))/(j*k)), where phi = Euler totient function (A000010).
From Vaclav Kotesovec, Oct 09 2018: (Start)
a(n) ~ s*p / r^(n+1), where
r = A192918 = ((17 + 3*sqrt(33))^(1/3) - 2/(17 + 3*sqrt(33))^(1/3) - 1)/3 = 0.54368901269207636157085597180174798652520329765098393524... is the real root of the equation 1 - r - r^2 - r^3 = 0,
s = (51 + 9*sqrt(33))/(4*(17 + 3*sqrt(33))^(1/3) + (17 + 3*sqrt(33))^(5/3) - 34 - 6*sqrt(33)) = 0.3362281169949410942253629540143324151579260900204592... is the real root of the equation -1 - 2*s + 44*s^3 = 0,
p = Product_{k>=2} 1/(1 - r^k - r^(2*k) - r^(3*k)) = 2.577933056783997593784130068093034525002002622982961271582417329674...
(End)
Showing 1-8 of 8 results.