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.

A054158 Inverse Moebius transform of A001371 (starting at term 0).

Original entry on oeis.org

1, 3, 2, 5, 4, 10, 9, 21, 26, 48, 70, 136, 209, 389, 673, 1235, 2221, 4144, 7631, 14358, 26941, 51016, 96783, 184560, 352454, 675391, 1296503, 2494071, 4805389, 9273501, 17919559, 34670835, 67156871, 130218219, 252741267, 490988734
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

A054160 Moebius transform of A001371 (starting at term 0).

Original entry on oeis.org

1, 1, 0, 0, 2, 4, 7, 14, 23, 38, 68, 118, 207, 369, 665, 1198, 2219, 4081, 7629, 14266, 26923, 50874, 96781, 184270, 352447, 674971, 1296453, 2493302, 4805387, 9272067, 17919557, 34668386, 67156731, 130213775, 252741245
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

Crossrefs

Cf. A054158.

Extensions

All values replaced by R. J. Mathar, Oct 13 2008

A054195 Binomial transform of A001371.

Original entry on oeis.org

1, 3, 6, 12, 26, 62, 157, 409, 1079, 2863, 7617, 20299, 54202, 145134, 390048, 1052840, 2855633, 7784909, 21333806, 58769738, 162735221, 452890963, 1266501060, 3558037366, 10038873751, 28437746721, 80854303650, 230659891380
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

A000031 Number of n-bead necklaces with 2 colors when turning over is not allowed; also number of output sequences from a simple n-stage cycling shift register; also number of binary irreducible polynomials whose degree divides n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 14, 20, 36, 60, 108, 188, 352, 632, 1182, 2192, 4116, 7712, 14602, 27596, 52488, 99880, 190746, 364724, 699252, 1342184, 2581428, 4971068, 9587580, 18512792, 35792568, 69273668, 134219796, 260301176, 505294128, 981706832
Offset: 0

Views

Author

Keywords

Comments

Also a(n)-1 is the number of 1's in the truth table for the lexicographically least de Bruijn cycle (Fredricksen).
In music, a(n) is the number of distinct classes of scales and chords in an n-note equal-tempered tuning system. - Paul Cantrell, Dec 28 2011
Also, minimum cardinality of an unavoidable set of length-n binary words (Champarnaud, Hansel, Perrin). - Jeffrey Shallit, Jan 10 2019
(1/n) * Dirichlet convolution of phi(n) and 2^n, n>0. - Richard L. Ollerton, May 06 2021
From Jianing Song, Nov 13 2021: (Start)
a(n) is even for n != 0, 2. Proof: write n = 2^e * s with odd s, then a(n) * s = Sum_{d|s} Sum_{k=0..e} phi((2^e*s)/(2^k*d)) * 2^(2^k*d-e) = Sum_{d|s} Sum_{k=0..e-1} phi(s/d) * 2^(2^k*d-k-1) + Sum_{d|s} phi(s/d) * 2^(2^e*d-e) == Sum_{k=0..e-1} 2^(2^k*s-k-1) + 2^(2^e*s-e) == Sum_{k=0..min{e-1,1}} 2^(2^k*s-k-1) (mod 2). a(n) is odd if and only if s = 1 and e-1 = 0, or n = 2.
a(n) == 2 (mod 4) if and only if n = 1, 4 or n = 2*p^e with prime p == 3 (mod 4).
a(n) == 4 (mod 8) if and only if n = 2^e, 3*2^e for e >= 3, or n = p^e, 4*p^e != 12 with prime p == 3 (mod 4), or n = 2s where s is an odd number such that phi(s) == 4 (mod 8). (End)

Examples

			For n=3 and n=4 the necklaces are {000,001,011,111} and {0000,0001,0011,0101,0111,1111}.
The analogous shift register sequences are {000..., 001001..., 011011..., 111...} and {000..., 00010001..., 00110011..., 0101..., 01110111..., 111...}.
		

References

  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967, pp. 120, 172.
  • May, Robert M. "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).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 2 of A075195.
Cf. A001037 (primitive solutions to same problem), A014580, A000016, A000013, A000029 (if turning over is allowed), A000011, A001371, A058766.
Rows sums of triangle in A047996.
Dividing by 2 gives A053634.
A008965(n) = a(n) - 1 allowing different offsets.
Cf. A008965, A053635, A052823, A100447 (bisection).
Cf. A000010.

Programs

  • Haskell
    a000031 0 = 1
    a000031 n = (`div` n) $ sum $
       zipWith (*) (map a000010 divs) (map a000079 $ reverse divs)
       where divs = a027750_row n
    -- Reinhard Zumkeller, Mar 21 2013
    
  • Maple
    with(numtheory); A000031 := proc(n) local d,s; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+phi(d)*2^(n/d); od; RETURN(s/n); fi; end; [ seq(A000031(n), n=0..50) ];
  • Mathematica
    a[n_] := Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n/d), 0], {d, 1, n}]/n
    a[n_] := Fold[#1 + 2^(n/#2) EulerPhi[#2] &, 0, Divisors[n]]/n (* Ben Branman, Jan 08 2011 *)
    Table[Expand[CycleIndex[CyclicGroup[n], t] /. Table[t[i]-> 2, {i, 1, n}]], {n,0, 30}] (* Geoffrey Critzer, Mar 06 2011*)
    a[0] = 1; a[n_] := DivisorSum[n, EulerPhi[#]*2^(n/#)&]/n; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 03 2016 *)
    mx=40; CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-2*x^i]/i,{i,1,mx}],{x,0,mx}],x] (*Herbert Kociemba, Oct 29 2016 *)
  • PARI
    {A000031(n)=if(n==0,1,sumdiv(n,d,eulerphi(d)*2^(n/d))/n)} \\ Randall L Rathbun, Jan 11 2002
    
  • Python
    from sympy import totient, divisors
    def A000031(n): return sum(totient(d)*(1<Chai Wah Wu, Nov 16 2022

Formula

a(n) = (1/n)*Sum_{ d divides n } phi(d)*2^(n/d) = A053635(n)/n, where phi is A000010.
Warning: easily confused with A001037, which has a similar formula.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 2*x^n)/n. - Herbert Kociemba, Oct 29 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 2^gcd(n,k). - Ilya Gutkovskiy, Apr 16 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 2^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 06 2021
Dirichlet g.f.: f(s+1) * (zeta(s)/zeta(s+1)), where f(s) = Sum_{n>=1} 2^n/n^s. - Jianing Song, Nov 13 2021

Extensions

There is an error in Fig. M3860 in the 1995 Encyclopedia of Integer Sequences: in the third line, the formula for A000031 = M0564 should be (1/n) sum phi(d) 2^(n/d).

A000029 Number of necklaces with n beads of 2 colors, allowing turning over (these are also called bracelets).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 13, 18, 30, 46, 78, 126, 224, 380, 687, 1224, 2250, 4112, 7685, 14310, 27012, 50964, 96909, 184410, 352698, 675188, 1296858, 2493726, 4806078, 9272780, 17920860, 34669602, 67159050, 130216124, 252745368, 490984488, 954637558, 1857545300
Offset: 0

Views

Author

Keywords

Comments

"Necklaces with turning over allowed" are usually called bracelets. - Joerg Arndt, Jun 10 2016

Examples

			For n=2, the three bracelets are AA, AB, and BB. For n=3, the four bracelets are AAA, AAB, ABB, and BBB. - _Robert A. Russell_, Sep 24 2018
		

References

  • J. L. Fisher, Application-Oriented Algebra (1977), ISBN 0-7002-2504-8, circa p. 215.
  • Martin Gardner, "New Mathematical Diversions from Scientific American" (Simon and Schuster, New York, 1966), pages 245-246.
  • 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).
  • N. Zagaglia Salvi, Ordered partitions and colourings of cycles and necklaces, Bull. Inst. Combin. Appl., 27 (1999), 37-40.

Crossrefs

Row sums of triangle in A052307, second column of A081720, column 2 of A051137.
Cf. A000011, A000013, A000031 (turning over not allowed), A001371 (primitive necklaces), A059076, A164090.

Programs

  • Maple
    with(numtheory): A000029 := proc(n) local d,s; if n = 0 then return 1 else if n mod 2 = 1 then s := 2^((n-1)/2) else s := 2^(n/2-2)+2^(n/2-1) fi; for d in divisors(n) do s := s+phi(d)*2^(n/d)/(2*n) od; return s; fi end:
  • Mathematica
    a[0] := 1; a[n_] := Fold[#1 + EulerPhi[#2]2^(n/#2)/(2n) &, If[OddQ[n], 2^((n - 1)/2), 2^(n/2 - 1) + 2^(n/2 - 2)], Divisors[n]]
    mx=40;CoefficientList[Series[(1-Sum[ EulerPhi[n]*Log[1-2*x^n]/n,{n,mx}]+(1+x)^2/(1-2*x^2))/2,{x,0,mx}],x] (* Herbert Kociemba, Nov 02 2016 *)
    a[0] = 1; a[n_] := (1/4)*(Mod[n, 2] + 3)*2^Quotient[n, 2] + DivisorSum[n, EulerPhi[#]*2^(n/#)&]/(2*n); Array[a, 36, 0] (* Jean-François Alcover, Nov 05 2017 *)
  • PARI
    a(n)=if(n<1,!n,(n%2+3)/4*2^(n\2)+sumdiv(n,d,eulerphi(n/d)*2^d)/2/n)
    
  • Python
    from sympy import divisors, totient
    def a(n):
        return 1 if n<1 else ((2**(n//2+1) if n%2 else 3*2**(n//2-1)) + sum(totient(n//d)*2**d for d in divisors(n))//n)//2
    print([a(n) for n in range(51)]) # Indranil Ghosh, Apr 23 2017

Formula

a(n) = Sum_{d divides n} phi(d)*2^(n/d)/(2*n) + either 2^((n - 1)/2) if n odd or 2^(n/2 - 1) + 2^(n/2 - 2) if n even.
G.f.: (1 - Sum_{n>=1} phi(n)*log(1 - 2*x^n)/n + (1 + x)^2/(1 - 2*x^2))/2. - Herbert Kociemba, Nov 02 2016
Equals (A000031 + A164090) / 2 = A000031 - A059076 = A059076 + A164090. - Robert A. Russell, Sep 24 2018
From Richard L. Ollerton, May 04 2021: (Start)
a(0) = 1; a(n) = Sum_{k=1..n} 2^gcd(n,k)/(2*n) + either 2^((n - 1)/2) if n odd or 2^(n/2 - 1) + 2^(n/2 - 2) if n even.
a(0) = 1; a(n) = A000031(n)/2 + (2^floor((n+1)/2) + 2^ceiling((n+1)/2))/4. See A051137. (End)

Extensions

More terms from Christian G. Bower

A276550 Array read by antidiagonals: T(n,k) = number of primitive (period n) bracelets using a maximum of k different colored beads.

Original entry on oeis.org

1, 2, 0, 3, 1, 0, 4, 3, 2, 0, 5, 6, 7, 3, 0, 6, 10, 16, 15, 6, 0, 7, 15, 30, 45, 36, 8, 0, 8, 21, 50, 105, 132, 79, 16, 0, 9, 28, 77, 210, 372, 404, 195, 24, 0, 10, 36, 112, 378, 882, 1460, 1296, 477, 42, 0, 11, 45, 156, 630, 1848, 4220, 5890, 4380, 1209, 69, 0
Offset: 1

Views

Author

Andrew Howroyd, Apr 09 2017

Keywords

Comments

Turning over will not create a new bracelet.

Examples

			Table starts:
  1  2   3    4     5      6      7       8 ...
  0  1   3    6    10     15     21      28 ...
  0  2   7   16    30     50     77     112 ...
  0  3  15   45   105    210    378     630 ...
  0  6  36  132   372    882   1848    3528 ...
  0  8  79  404  1460   4220  10423   22904 ...
  0 16 195 1296  5890  20640  60021  151840 ...
  0 24 477 4380 25275 107100 364854 1057392 ...
  ...
		

Crossrefs

Programs

  • Maple
    A276550 := proc(n,k)
        local d ;
        add( numtheory[mobius](n/d)*A081720(d,k),d=numtheory[divisors](n)) ;
    end proc:
    seq(seq(A276550(n,d-n),n=1..d-1),d=2..10) ; # R. J. Mathar, Jan 22 2022
  • Mathematica
    t[n_, k_] := Sum[EulerPhi[d] k^(n/d), {d, Divisors[n]}]/(2n) + (k^Floor[(n+1)/2] + k^Ceiling[(n+1)/2])/4;
    T[n_, k_] := Sum[MoebiusMu[d] t[n/d, k], {d, Divisors[n]}];
    Table[T[n-k+1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Mar 26 2020 *)

Formula

T(n, k) = Sum_{d|n} mu(n/d) * A081720(d,k) for k<=n. Corrected Jan 22 2022

A056348 Number of primitive (period n) bracelets using exactly two different colored beads.

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 16, 24, 42, 69, 124, 208, 378, 668, 1214, 2220, 4110, 7630, 14308, 26931, 50944, 96782, 184408, 352450, 675180, 1296477, 2493680, 4805388, 9272778, 17919558, 34669600
Offset: 1

Views

Author

Keywords

Comments

Turning over will not create a new bracelet. Identical to A001371 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

Cf. A001037.

Formula

Sum mu(d)*A056342(n/d) where d divides n.

A115119 Number of imprimitive (periodic) n-bead necklaces with beads of 2 colors when turning over is allowed.

Original entry on oeis.org

0, 0, 2, 2, 3, 2, 5, 2, 6, 4, 9, 2, 16, 2, 19, 10, 30, 2, 55, 2, 81, 20, 127, 2, 248, 8, 381, 46, 690, 2, 1302, 2, 2250, 128, 4113, 24, 7896, 2, 14311, 382, 27036, 2, 51641, 2, 96912, 1266, 184411, 2, 354918, 18, 675258, 4114, 1296861, 2, 2501365, 132, 4806102, 14312
Offset: 0

Views

Author

Valery A. Liskovets, Jan 17 2006

Keywords

Comments

a(p)=2 for prime p.

Crossrefs

Programs

  • Mathematica
    a29[n_] := a29[n] = (s = If[OddQ[n], 2^((n-1)/2), 2^(n/2-2) + 2^(n/2 - 1)]; a29[0] = 1; Do[s = s + EulerPhi[d] 2^(n/d)/(2n), {d, Divisors[n]}]; s);
    a1371[n_] := Sum[MoebiusMu[d] a29[n/d], {d, Divisors[n]}]; a1371[0] = 1;
    a[0] = 0; a[n_] := a29[n] - a1371[n];
    Array[a, 70, 0] (* Jean-François Alcover, Aug 28 2019 *)

Formula

a(n) = A000029(n) - A001371(n).

Extensions

More terms from Jean-François Alcover, Aug 28 2019
Showing 1-8 of 8 results.