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

A000048 Number of n-bead necklaces with beads of 2 colors and primitive period n, when turning over is not allowed but the two colors can be interchanged.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 9, 16, 28, 51, 93, 170, 315, 585, 1091, 2048, 3855, 7280, 13797, 26214, 49929, 95325, 182361, 349520, 671088, 1290555, 2485504, 4793490, 9256395, 17895679, 34636833, 67108864, 130150493, 252645135, 490853403, 954437120, 1857283155
Offset: 0

Views

Author

Keywords

Comments

Also, for any m which is a multiple of n, the number of 2m-bead balanced binary necklaces of fundamental period 2n that are equivalent to their complements. [Clarified by Aaron Meyerowitz, Jun 01 2024]
Also binary Lyndon words of length n with an odd number of 1's (for n>=1).
Also number of binary irreducible polynomials of degree n having trace 1.
Also number of binary irreducible polynomials of degree n having linear coefficient 1 (this is the same as the trace-1 condition, as the reciprocal of an irreducible polynomial is again irreducible).
Also number of binary irreducible self-reciprocal polynomials of degree 2*n; there is no such polynomial for odd degree except for x+1.
Also number of binary vectors (x_1,...x_n) satisfying Sum_{i=1..n} i*x_i = 1 (mod n+1) = size of Varshamov-Tenengolts code VT_1(n).
Also the number of dynamical cycles of period 2n of a threshold Boolean automata network which is a quasi-minimal negative circuit of size nq where q is odd and which is updated in parallel. - Mathilde Noual (mathilde.noual(AT)ens-lyon.fr), Mar 03 2009
Also the number of 3-elements orbits of the symmetric group S3 action on irreducible polynomials of degree 2n, n>1, over GF(2). - Jean Francis Michon, Philippe Ravache (philippe.ravache(AT)univ-rouen.fr), Oct 04 2009
Conjecture: Also the number of caliber-n cycles of Zagier-reduced indefinite binary quadratic forms with sum invariant equal to s, where (s-1)/n is an odd integer. - Barry R. Smith, Dec 14 2014
The Metropolis, Stein, Stein (1973) reference on page 31 Table II lists a(k) for k = 2 to 15 and is actually for sequence A056303 since there a(k) = 0 for k<2. - Michael Somos, Dec 20 2014

Examples

			a(5) = 3 corresponding to the necklaces 00001, 00111, 01011.
a(6) = 5 from 000001, 000011, 000101, 000111, 001011.
		

References

  • B. D. Ginsburg, On a number theory function applicable in coding theory, Problemy Kibernetiki, No. 19 (1967), pp. 249-252.
  • H. Kawakami, Table of rotation sequences of x_{n+1} = x_n^2 - lambda, pp. 73-92 of G. Ikegami, Editor, Dynamical Systems and Nonlinear Oscillations, Vol. 1, World Scientific, 1986.
  • Robert M. May, "Simple mathematical models with very complicated dynamics." Nature, Vol. 261, June 10, 1976, pp. 459-467; reprinted in The Theory of Chaotic Attractors, pp. 85-93. Springer, New York, NY, 2004. The sequences listed in Table 2 are A000079, A027375, A000031, A001037, A000048, A051841. - N. J. A. Sloane, Mar 17 2019
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Like A000013, but primitive necklaces. Half of A064355.
Equals A042981 + A042982.
Cf. also A001037, A056303.
Very close to A006788 [Fisher, 1989].
bisection (odd terms) is A131203

Programs

  • Maple
    with(numtheory); A000048 := proc(n) local d,t1; if n = 0 then RETURN(1) else t1 := 0; for d from 1 to n do if n mod d = 0 and d mod 2 = 1 then t1 := t1+mobius(d)*2^(n/d)/(2*n); fi; od; RETURN(t1); fi; end;
  • Mathematica
    a[n_] := Total[ MoebiusMu[#]*2^(n/#)& /@ Select[ Divisors[n], OddQ]]/(2n); a[0] = 1; Table[a[n], {n,0,35}] (* Jean-François Alcover, Jul 21 2011 *)
    a[ n_] := If[ n < 1, Boole[n == 0], DivisorSum[ n, MoebiusMu[#] 2^(n/#) &, OddQ] / (2 n)]; (* Michael Somos, Dec 20 2014 *)
  • PARI
    A000048(n) = sumdiv(n,d,(d%2)*(moebius(d)*2^(n/d)))/(2*n) \\ Michael B. Porter, Nov 09 2009
    
  • PARI
    L(n, k) = sumdiv(gcd(n,k), d, moebius(d) * binomial(n/d, k/d) );
    a(n) = sum(k=0, n, if( (n+k)%2==1, L(n, k), 0 ) ) / n;
    vector(55,n,a(n)) \\ Joerg Arndt, Jun 28 2012
    
  • Python
    from sympy import divisors, mobius
    def a(n): return 1 if n<1 else sum(mobius(d)*2**(n//d) for d in divisors(n) if d%2)//(2*n) # Indranil Ghosh, Apr 28 2017

Formula

a(n) = (1/(2*n)) * Sum_{odd d divides n} mu(d)*2^(n/d), where mu is the Mobius function A008683.
a(n) = A056303(n) for all integer n>=2. - Michael Somos, Dec 20 2014
Sum_{k dividing m for which m/k is odd} k*a(k) = 2^(m-1). (This explains the observation that the sequence is very close to A006788. Unless m has some nontrivial odd divisors that are small relative to m, the term m*a(m) will dominate the sum. Thus, we see for instance that a(n) = A006788(n) when n has one of the forms 2^m or 2^m*p where p is an odd prime with a(2^m) < p.) - Barry R. Smith, Oct 24 2015
A000013(n) = Sum_{d|n} a(d). - Robert A. Russell, Jun 09 2019
G.f.: 1 + Sum_{k>=1} mu(2*k)*log(1 - 2*x^k)/(2*k). - Ilya Gutkovskiy, Nov 11 2019

Extensions

Additional comments from Frank Ruskey, Dec 13 1999

A052343 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed).

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 2, 1, 0, 1, 1, 1, 1, 1, 0, 1, 2, 0, 1, 0, 1, 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, 2, 0, 0, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 1, 2, 0, 1, 1, 0, 2, 0, 0, 0, 2, 2, 1, 1, 0, 1, 1, 0, 0, 1, 1, 2, 1, 0, 1, 1, 0, 2, 1, 0, 0, 2, 0, 1, 1, 0, 3, 0, 1, 1, 0, 0, 1, 1, 0, 1, 2, 1, 1, 2, 0, 0, 1, 0, 1, 1, 1
Offset: 0

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Comments

Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed). - Michael Somos, Aug 18 2003
a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - Reinhard Zumkeller, May 15 2006
Also, number of ways to write 4n+1 as the unordered sum of two squares of nonnegative integers. - Vladimir Shevelev, Jan 21 2009
The average value of a(n) for n <= x is Pi/4 + O(1/sqrt(x)). - Vladimir Shevelev, Feb 06 2009

Examples

			G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^6 + x^7 + x^9 + x^10 + x^11 + ...
		

Crossrefs

Programs

  • Haskell
    a052343 = (flip div 2) . (+ 1) . a008441
    -- Reinhard Zumkeller, Jul 25 2014
  • Maple
    A052343 := proc(n)
        local a,t1idx,t2idx,t1,t2;
        a := 0 ;
        for t1idx from 0 do
            t1 := A000217(t1idx) ;
            if t1 > n then
                break;
            end if;
            for t2idx from t1idx do
                t2 := A000217(t2idx) ;
                if t1+t2 > n then
                    break;
                elif t1+t2 = n then
                    a := a+1 ;
                end if;
            end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Apr 28 2020
  • Mathematica
    Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* Ant King, Dec 01 2010 *)
    d1[k_]:=Length[Select[Divisors[k],Mod[#,4]==1&]];d3[k_]:=Length[Select[Divisors[k],Mod[#,4]==3&]];f[k_]:=d1[k]-d3[k];g[k_]:=If[IntegerQ[Sqrt[4k+1]],1/2 (f[4k+1]+1),1/2 f[4k+1]];g[#]&/@Range[0,101] (* Ant King, Dec 01 2010 *)
    a[ n_] := Length @ Select[ Table[ Sqrt[n - i - i^2], {i, 0, Quotient[ Sqrt[4 n + 1] - 1, 2]}], IntegerQ]; (* Michael Somos, Jul 28 2015 *)
    a[ n_] := Length @ FindInstance[ {j >= 0, k >= 0, j^2 + k^2 + k == n}, {k, j}, Integers, 10^9]; (* Michael Somos, Jul 28 2015 *)
  • PARI
    {a(n) = if( n<0, 0, sum(i=0, (sqrtint(4*n + 1) - 1)\2, issquare(n - i - i^2)))}; /* Michael Somos, Aug 18 2003 */
    

Formula

a(n) = ceiling(A008441(n)/2). - Reinhard Zumkeller, Nov 03 2009
G.f.: (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k>=0} x^(k^2)). - Michael Somos, Aug 18 2003
Recurrence: a(n) = Sum_{k=1..r(n)} r(2n-k^2+k) - C(r(n),2) - a(n-1) - a(n-2) - ... - a(0), n>=1,a (0)=1, where r(n)=A000194(n+1) is the nearest integer to square root of n+1. For example, since r(6)=3, a(6) = r(12) + r(10) + r(6) - C(3,2) - a(5) - ... - a(0) = 4 + 3 + 3 - 3 - 0 - 1 - 1 - 1 - 1 - 1 = 2. - Vladimir Shevelev, Feb 06 2009
a(n) = A025426(8n+2). - Max Alekseyev, Mar 09 2009
a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - Ant King, Dec 01 2010
a(2*n + 1) = A053692(n). a(4*n + 1) = A259287(n). a(4*n + 3) = A259285(n). a(6*n + 1) = A260415(n). a(6*n + 4) = A260516(n). - Michael Somos, Jul 28 2015
a(3*n) = A093518(n). a(3*n + 1) = A121444(n). a(9*n + 2) = a(n). a(9*n + 5) = a(9*n + 8) = 0. - Michael Somos, Jul 28 2015
Convolution of A005369 and A010052. - Michael Somos, Jul 28 2015

A107424 Triangle read by rows: T(n, k) is the number of primitive (period n) n-bead necklace structures with k different colors. Only includes structures that contain all k colors.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 3, 5, 2, 1, 0, 5, 17, 13, 3, 1, 0, 9, 43, 50, 20, 3, 1, 0, 16, 124, 220, 136, 36, 4, 1, 0, 28, 338, 866, 773, 296, 52, 4, 1, 0, 51, 941, 3435, 4280, 2303, 596, 78, 5, 1, 0, 93, 2591, 13250, 22430, 16317, 5817, 1080, 105, 5, 1, 0, 170, 7234, 51061
Offset: 1

Views

Author

David Wasserman, May 26 2005

Keywords

Comments

This classification is concerned with which beads are the same color, not with the colors themselves, so bbabcd is the same structure as aabacd. Cyclic permutations are also the same structure, e.g. abacda is also the same structure. However, order matters: the reverse of aabacd is equivalent to aabcad, which is also on the list.

Examples

			T(6, 4) = 13: {aaabcd, aabacd, aabcad, abacad, aabbcd, aabcbd, aabcdb, aacbbd, aacbdb, ababcd, abacbd, acabdb, abcabd}.
From _Andrew Howroyd_, Apr 09 2017 (Start)
Triangle starts:
1
0  1
0  1   1
0  2   2    1
0  3   5    2    1
0  5  17   13    3    1
0  9  43   50   20    3   1
0 16 124  220  136   36   4  1
0 28 338  866  773  296  52  4 1
0 51 941 3435 4280 2303 596 78 5 1
(End)
		

Crossrefs

Columns 2-6 are A056303, A056304, A056305, A056306, A056307.
Partial row sums include A000048, A002075, A056300, A056301, A056302.
Row sums are A276547.

Programs

  • Mathematica
    A[d_, n_] := A[d, n] = Which[n == 0, 1, n == 1, DivisorSum[d, x^# &], d == 1, Sum[StirlingS2[n, k] x^k, {k, 0, n}], True, Expand[A[d, 1] A[d, n-1] + D[A[d, n-1], x] x]];
    B[n_, k_] := Coefficient[DivisorSum[n, EulerPhi[#] A[#, n/#]&]/n/x, x, k];
    T[n_, k_] := DivisorSum[n, MoebiusMu[n/#] B[#, k]&];
    Table[T[n, k], {n, 1, 12}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Jun 06 2018, after Andrew Howroyd and Robert A. Russell *)
  • PARI
    \\ here R(n) is A152175 as square matrix.
    R(n) = {Mat(Col([Vecrev(p/y, n) | p<-Vec(intformal(sum(m=1, n, eulerphi(m) * subst(serlaplace(-1 + exp(sumdiv(m, d, y^d*(exp(d*x + O(x*x^(n\m)))-1)/d))), x, x^m))/x))]))}
    T(n) = {my(M=R(n)); matrix(n, n, i, k, sumdiv(i, d, moebius(i/d)*M[d,k]))}
    { my(A=T(10)); for(n=1, #A, print(A[n, 1..n])) } \\ Andrew Howroyd, Jan 09 2020

Formula

T(n, k) = Sum_{d|n} mu(n/d) * A152175(d, k). - Andrew Howroyd, Apr 09 2017

A052344 Number of ways to write n as the unordered sum of two nonzero triangular numbers.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 2, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 2, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 2, 0, 1, 1, 0, 2, 0, 0, 0, 1, 2, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 2, 1, 0, 0, 2, 0, 0, 1, 0, 3, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 0, 0, 1, 0, 1, 1, 1
Offset: 0

Views

Author

Christian G. Bower, Jan 23 2000

Keywords

Comments

Number of ways to write 8*n+2 as the unordered sum of two odd squares > 1. - Robert Israel, Feb 24 2016
Number of partitions of 2n into two promic numbers > 1. - Wesley Ivan Hurt, Jun 09 2021

Crossrefs

Programs

  • Maple
    G:= (1/8)*(JacobiTheta2(0, sqrt(q))^2-4*JacobiTheta2(0, sqrt(q))*q^(1/8)+2*JacobiTheta2(0, q))/q^(1/4):
    S:= series(G,q,1001):
    seq(coeff(S,q,j),j=0..1000); # Robert Israel, Feb 24 2016
  • Mathematica
    nn=150; tri=Accumulate[Range[nn]]; t=Table[0, {tri[[-1]]}]; Do[n=tri[[i]]+tri[[j]]; If[n <= tri[[-1]], t[[n]]++], {i,nn}, {j,i}]; t=Prepend[t,0]

Formula

G.f.: (Theta_2(sqrt(x))^2 - 4*x^(1/8)*Theta_2(sqrt(x)) + 2*Theta_2(x))/(8*x^(1/4)) where Theta_2 is a Jacobi theta function. - Robert Israel, Feb 24 2016
a(n) = Sum_{k=1..n} c(k) * c(2*n-k), where c(n) is the characteristic function of promic numbers (A005369). - Wesley Ivan Hurt, Jun 09 2021
a(n) = Sum_{k=1..floor(n/2)} c(k) * c(n-k), where c = A010054. - Wesley Ivan Hurt, Jan 06 2024

A187767 Number of bicolored cyclic patterns n X n.

Original entry on oeis.org

0, 2, 3, 10, 15, 35, 63, 138, 255, 527, 1023, 2083, 4095, 8255, 16383, 32906, 65535, 131327, 262143, 524815, 1048575, 2098175, 4194303, 8390691, 16777215, 33558527, 67108863, 134225983, 268435455, 536887295, 1073741823, 2147516554, 4294967295, 8590000127, 17179869183
Offset: 1

Views

Author

Giovanni Resta, Jan 04 2013

Keywords

Comments

A bicolored cyclic pattern is a 0-1 n x n matrix where the j-th row is equal to the first row rotated to the left by (j-1)*k places, with 1 <= k <= n a parameter. For example, with first row = 0110 we have
.
. (k=1) 0 1 1 0 (k=2) 0 1 1 0 (k=3) 0 1 1 0 (k=4) 0 1 1 0
. 1 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0
. 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0
. 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0
The (2^n-2)*n matrices so obtained are reduced considering equivalent those obtained exchanging 0's and 1's and those which produce the same pattern, apart translation.

Examples

			a(4)=10 is represented below. See Links for more examples.
. 1000 0100 0010 0001 0101 1010 1001 0110 1100 0011
. 0100 0001 0100 0001 0101 0101 1100 1100 0011 0011
. 0010 0100 1000 0001 0101 1010 0110 1001 1100 0011
. 0001 0001 0001 0001 0101 0101 0011 0011 0011 0011
		

Crossrefs

The number of patterns made of vertical stripes only is A056295(n).

Programs

  • Mathematica
    cyPatt[n_]:=Block[{b,c},c[v_,q_:1]:=Table[RotateLeft[v,i q],{i,n}]; b=Union[(First@Union[c@#,c[1-#]])& /@ IntegerDigits[Range[2^n/2-1], 2,n]]; Union@Flatten[Table[c[e,j],{j,n},{e,b}],1]];
    (*count*) a[n_] := Length@cyPatt@n; Print["Seq = ",a/@Range[12]];
    (*show*) showP[p_] := GraphicsGrid@Partition[ArrayPlot/@p,8,8,1,Null];
    showP[cyPatt[6]]
  • PARI
    b(n)=sumdiv(n,d,(d%2)*(moebius(d)*2^(n/d)))/(2*n);
    a(n)=sumdiv(n,d,d*b(d)) - 1; \\ Andrew Howroyd, Jun 02 2017

Formula

a(1) = 0; a(n) = 2^(n-1)-1 if n is odd, 2^(n-1)+a(n/2) if n is even (conjectured).
a(n) = -1 + Sum_{d|n} d*A000048(d). - Andrew Howroyd, Jun 02 2017

Extensions

a(22)-a(35) from Andrew Howroyd, Jun 02 2017

A056366 Number of primitive (period n) bracelet structures using exactly two different colored beads.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 14, 21, 39, 62, 112, 189, 352, 607, 1144, 2055, 3885, 7154, 13602, 25472, 48670, 92204, 176770, 337590, 649341, 1246840, 2404872, 4636389, 8964143, 17334800
Offset: 1

Views

Author

Keywords

Comments

Turning over will not create a new bracelet. Permuting the colors of the beads will not change the structure. Identical to A000046 for n>1.

References

  • M. R. Nester (1999). Mathematical investigations of some plant interaction designs. PhD Thesis. University of Queensland, Brisbane, Australia. [See A056391 for pdf file of Chap. 2]

Crossrefs

Column 2 of A276543.
Cf. A056303.

Formula

A000046(n)-A000007(n-1).

A068330 Consider all sublists of [(2,1),(3,2,1),(4,3,2,1),...,(n,...,4,3,2,1)] and multiply these permutations in that order. How many of the products are n-cycles?

Original entry on oeis.org

1, 1, 1, 2, 4, 6, 11, 20, 36, 65, 118, 215, 389, 727, 1366, 2565, 4849, 9123, 17168, 32629, 62121, 118353, 226603, 434512, 833776, 1605642, 3101121, 5993545, 11593548, 22443167, 43459975, 84209877, 163359383, 317230531, 616506533, 1199200964, 2334860706, 4549377408, 8870694723
Offset: 1

Views

Author

Simon P. Norton, Feb 27 2002

Keywords

Comments

If we take the inverse permutations to the above, or, equivalently, multiply them in the reverse order, we get another description of the sequences A000048 or A056303 with the first term omitted in each case.

Examples

			a[5] (the output of the program below in which a is the list of the first n terms of the sequence) is 4 because that is the number of products of sublists of [(2,1),(3,2,1),(4,3,2,1),(5,4,3,2,1)] which are 5-cycles, namely (5,4,3,2,1) itself, (3,2,1)*(5,4,3,2,1) = (5,4,3,1,2), (2,1)*(4,3,2,1)*(5,4,3,2,1) = (5,4,2,3,1) and (2,1)*(3,2,1)*(4,3,2,1)*(5,4,3,2,1) = (5,4,2,1,3).
		

Crossrefs

Programs

  • GAP
    a := []; p := (); perms := [p]; for i in [1..n] do pp := perms*p; pp1 := Filtered(pp,m -> CycleLength(m,[1..i],1) = i); a[i] := Length(pp1); perms := Union(perms, pp); p := p*(i,i+1); od;

Extensions

a(21)-a(33) from Sean A. Irvine, Feb 10 2024
a(34)-a(39) from Bert Dobbelaere, May 29 2025
Showing 1-7 of 7 results.