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

A000013 Definition (1): Number of n-bead binary necklaces with beads of 2 colors where the colors may be swapped but turning over is not allowed.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 8, 10, 20, 30, 56, 94, 180, 316, 596, 1096, 2068, 3856, 7316, 13798, 26272, 49940, 95420, 182362, 349716, 671092, 1290872, 2485534, 4794088, 9256396, 17896832, 34636834, 67110932, 130150588, 252648992, 490853416, 954444608, 1857283156, 3616828364
Offset: 0

Views

Author

Keywords

Comments

Definition (2): Equivalently, number of different output sequences from an n-stage pure cycling shift register when 2 sequences are considered the same if one is the complement of the other.
Definition (3): Also number of different output sequences from an n-stage pure cycling shift register constrained so contents have even weight.
Definition (4): Also number of output sequences from (n-1)-stage shift register which feeds back the mod 2 sum of the contents of the register.
The equivalence of definitions (1) and (2) follows at once from the definitions.
If u is an output sequence of type (2) then its derivative is of type (3) - so (2) and (3) count the same things.
If we have a shift register of type (4), append a new cell which contains the mod 2 sum of the contents to get a shift register of type (3). So (3) and (4) count the same things.
If n is even, a(n) = A000116(n/2). If 2^(n+1)-1 is prime, then a(n) = A128976(n+1), the number of cycles in the digraph of the Lucas-Lehmer operator LL(x) = x^2 - 2 acting on Z/(2^(n+1)-1). - M. F. Hasler, May 19 2007
Also number of 2n-bead balanced binary necklaces that are equivalent to their complements. - Andrew Howroyd, Sep 29 2017

Examples

			G.f. = 1 + x + 2*x^2 + 2*x^3 + 4*x^4 + 4*x^5 + 8*x^6 + 10*x^7 + 20*x^8 + ...
		

References

  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967, p. 172.
  • 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

Programs

  • Haskell
    a000013 0 = 1
    a000013 n = sum (zipWith (*)
       (map (a000010 . (* 2)) ds) (map (2 ^) $ reverse ds)) `div` (2 * n)
       where ds = a027750_row n
    -- Reinhard Zumkeller, Jul 08 2013
    
  • Maple
    with(numtheory): A000013 := proc(n) local s,d; if n = 0 then RETURN(1) else s := 0; for d in divisors(n) do s := s+(phi(2*d)*2^(n/d))/(2*n); od; RETURN(s); fi; end;
  • Mathematica
    a[n_] := Fold[ #1 + EulerPhi[2#2]2^(n/#2)/(2n) &, 0, Divisors[n]]
    a[ n_] := If[ n < 1, Boole[n == 0], DivisorSum[ n, EulerPhi[2 #] 2^(n/#) &] / (2 n)]; (* Michael Somos, Dec 19 2014 *)
    mx=40;CoefficientList[Series[1-Sum[EulerPhi[2i] Log[1-2*x^i]/(2i),{i,1,mx}],{x,0,mx}],x] (* Herbert Kociemba, Nov 01 2016 *)
  • PARI
    {a(n) = if( n<1, n==0, sumdiv(n, k, eulerphi(2*k) * 2^(n/k)) / (2*n))}; /* Michael Somos, Oct 20 1999 */
    
  • Python
    from sympy import divisors, totient
    def a(n): return 1 if n<1 else sum([totient(2*d)*2**(n//d) for d in divisors(n)])//(2*n) # Indranil Ghosh, Apr 28 2017

Formula

a(n) = Sum_{ d divides n } (phi(2*d)*2^(n/d))/(2*n) for n>0. - Michael Somos, Oct 20 1999
G.f.: 1 - Sum_{i>=1} phi(2*i)*log(1-2*x^i)/(2*i). - Herbert Kociemba, Nov 01 2016
From Richard L. Ollerton, May 11 2021: (Start)
For n >= 1:
a(n) = (1/(2*n))*Sum_{k=1..n} phi(2*gcd(n,k))*2^(n/gcd(n,k))/phi(n/gcd(n,k)), where phi = A000010.
a(n) = (1/(2*n))*Sum_{k=1..n} phi(2*n/gcd(n,k))*2^gcd(n,k)/phi(n/gcd(n,k)). (End)
a(n) ~ 2^(n-1)/n. - Cedric Lorand, Apr 24 2022
a(n) = Sum_{k=1..n} A385665(n,k) = Sum_{d|n} A000048(d). - Tilman Piesk, Jul 31 2025

A026119 Bisection of A000016 (also of A000013).

Original entry on oeis.org

1, 2, 4, 10, 30, 94, 316, 1096, 3856, 13798, 49940, 182362, 671092, 2485534, 9256396, 34636834, 130150588, 490853416, 1857283156, 7048151672, 26817356776, 102280151422, 390937468408, 1497207322930, 5744387279818, 22076468764192
Offset: 0

Views

Author

N. J. A. Sloane, Apr 12 2000

Keywords

Crossrefs

Bisection of A053634 and A053656.

Programs

  • PARI
    a(n) = sumdiv(2*n+1, d, eulerphi(d)*2^((2*n+1)/d)) / (4*n+2); \\ Michel Marcus, Sep 11 2013
    
  • Python
    from sympy import totient, divisors
    def A026119(n):
        m = (n<<1)+1
        return sum(totient(d)<Chai Wah Wu, Feb 21 2023

Formula

a(n) = (Sum_{d | 2n+1} phi(d)*2^((2n+1)/d)) / (4n+2).

A000208 Number of even sequences with period 2n.

Original entry on oeis.org

1, 1, 3, 4, 12, 28, 94, 298, 1044, 3658, 13164, 47710, 174948, 645436, 2397342, 8948416, 33556500, 126324496, 477225962, 1808414182, 6871973952, 26178873448, 99955697946, 382438918234, 1466015854100, 5629499869780
Offset: 0

Views

Author

Keywords

Comments

These are binary sequences (sequences of 1's and 0's), and two sequences are considered the same if one can be transformed into the other by translation and/or exchanging 1 and 0. A periodic sequence can be represented by enclosing one period in parentheses (for example, (00011011)). Even sequences contain an even number of 1's and an even number of 0's. - Michael B. Porter, Dec 22 2019

Examples

			For n=2, the sequences of length 2n=4 are (0000), (0001), (0011), and (0101). The other 12 possibilities are equivalent - for example, the sequence (1001) is a translation of (0011), and the sequence (1101) is equivalent to (0001) by exchanging 1's and 0's and then translating. Since three of these have an even number of 1's, a(2) = 3. - _Michael B. Porter_, Dec 22 2019
		

References

  • 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

Programs

  • Haskell
    a000208 n = a000208_list !! n
    a000208_list = map (`div` 2) $ concat $ transpose
       [zipWith (+) a000116_list $ bis a000116_list, bis $ tail a000116_list]
       where bis (x:_:xs) = x : bis xs
    -- Reinhard Zumkeller, Jul 08 2013
  • Mathematica
    a[0] = 1; a13[0] = 1; a13[n_] := Fold[#1 + EulerPhi[2*#2]*(2^(n/#2)/(2*n)) & , 0, Divisors[n]]; a[(n_)?OddQ] := (a13[2*(n + 1)] + a13[n + 1])/2; a[(n_)?EvenQ] := a13[2*(n + 1)]/2; Table[a[n], {n, 0, 24}] (* Jean-François Alcover, Sep 01 2011, after PARI prog. *)
  • PARI
    {A000208(n)=if(n%2==0,(A000013(2*n)+A000013(n))/2, A000013(2*n)/2)}
    

Formula

a(n) = (A000013(2*n) + A000013(n))/2 if n is even, A000013(2*n)/2 if n is odd. - Randall L Rathbun, Jan 11 2002
a(2*n) = (A000116(2*n) + A000116(n)) / 2; a(2*n+1) = A000116(2*n+1) / 2. - Reinhard Zumkeller, Jul 08 2013

Extensions

More terms from Randall L Rathbun, Jan 11 2002
Showing 1-3 of 3 results.