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-10 of 45 results. Next

A000116 Number of even sequences with period 2n (bisection of A000013).

Original entry on oeis.org

1, 2, 4, 8, 20, 56, 180, 596, 2068, 7316, 26272, 95420, 349716, 1290872, 4794088, 17896832, 67110932, 252648992, 954444608, 3616828364, 13743921632, 52357746896, 199911300472, 764877836468, 2932031358484, 11258999739560, 43303843861744, 166799988689300
Offset: 0

Views

Author

Keywords

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
    a000116 n = a000116_list !! n
    a000116_list = bis a000013_list where bis (x:_:xs) = x : bis xs
    -- Reinhard Zumkeller, Jul 08 2013
  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(phi(2*d)*2^(2*n/d), d=divisors(2*n))/(4*n)):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 25 2012
  • Mathematica
    a[n_] := Sum[ EulerPhi[2d]*2^(2n/d), {d, Divisors[2n]}]/(4n); a[0]=1; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Sep 13 2012, after Alois P. Heinz *)

Formula

a(2*n) + a(n) = 2 * A000208(2*n); a(2*n+1) = 2 * A000208(2*n+1). - Reinhard Zumkeller, Jul 08 2013
a(n) ~ 4^(n-1) / n. - Cedric Lorand, Apr 18 2022

Extensions

More terms from David W. Wilson, Jan 13 2000

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).

A054168 Inverse Moebius transform of A000013 (starting at term 0).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 14, 23, 36, 57, 104, 181, 326, 603, 1110, 2069, 3884, 7317, 13836, 26283, 49998, 95421, 182476, 349721, 671274, 1290895, 2485862, 4794089, 9257034, 17896833, 34637944, 67110991, 130152658, 252649005, 490857396
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

A054170 Moebius transform of A000013 (starting at term 0).

Original entry on oeis.org

1, 0, 1, 1, 3, 2, 7, 8, 18, 26, 55, 89, 179, 308, 591, 1086, 2067, 3834, 7315, 13767, 26263, 49884, 95419, 182260, 349712, 670912, 1290852, 2485217, 4794087, 9255772, 17896831, 34635738, 67110875, 130148520, 252648981, 490849470
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

A054196 Binomial transform of A000013.

Original entry on oeis.org

1, 2, 5, 12, 29, 70, 169, 410, 1005, 2500, 6325, 16276, 42549, 112832, 303073, 823442, 2259917, 6256610, 17451117, 48984114, 138233969, 391876318, 1115233413, 3184379758, 9118632645, 26176992668, 75311867001, 217096296680, 626898050125
Offset: 0

Views

Author

N. J. A. Sloane, Apr 29 2000

Keywords

A054538 A000013 / 2.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 10, 15, 28, 47, 90, 158, 298, 548, 1034, 1928, 3658, 6899, 13136, 24970, 47710, 91181, 174858, 335546, 645436, 1242767, 2397044, 4628198, 8948416, 17318417, 33555466, 65075294, 126324496, 245426708
Offset: 1

Views

Author

N. J. A. Sloane, Apr 10 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).

A000011 Number of n-bead necklaces (turning over is allowed) where complements are equivalent.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 8, 9, 18, 23, 44, 63, 122, 190, 362, 612, 1162, 2056, 3914, 7155, 13648, 25482, 48734, 92205, 176906, 337594, 649532, 1246863, 2405236, 4636390, 8964800, 17334801, 33588234, 65108062, 126390032, 245492244, 477353376, 928772650, 1808676326, 3524337980
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the number of minimal fibrations of a bidirectional n-cycle over the 2-bouquet up to precompositions with automorphisms of the n-cycle and postcomposition with automorphisms of the 2-bouquet. (Boldi et al.) - Sebastiano Vigna, Jan 08 2018
For n >= 3, also the number of distinct planar embeddings of the n-sunlet graph. - Eric W. Weisstein, May 21 2024

Examples

			From Jason Orendorff (jason.orendorff(AT)gmail.com), Jan 09 2009: (Start)
The binary bracelets for small n are:
  n: bracelets
  0: (the empty bracelet)
  1: 0
  2: 00, 01
  3: 000, 001
  4: 0000, 0001, 0011, 0101
  5: 00000, 00001, 00011, 00101
  6: 000000, 000001, 000011, 000101, 000111, 001001, 001011, 010101
(End)
		

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

Column 2 of A320748.
Cf. A000013. Bisections give A000117 and A092668.
The 8 sequences in Table 8 of Fujita (2017) are A053656, A000011, A256216, A256217, A123045, A283846, A283847, A283848.

Programs

  • Maple
    with(numtheory): A000011 := proc(n) local s,d; if n = 0 then RETURN(1) else s := 2^(floor(n/2)); for d in divisors(n) do s := s+(phi(2*d)*2^(n/d))/(2*n); od; RETURN(s/2); fi; end;
  • Mathematica
    a[n_] := Fold[ #1 + EulerPhi[2#2]2^(n/#2)/(2n) &, 2^Floor[n/2], Divisors[n]]/2
    a[ n_] := If[ n < 1, Boole[n == 0], 2^Quotient[n, 2] / 2 + DivisorSum[ n, EulerPhi[2 #] 2^(n/#) &] / (4 n)]; (* Michael Somos, Dec 19 2014 *)
  • PARI
    {a(n) = if( n<1, n==0, 2^(n\2) / 2 + sumdiv(n, k, eulerphi(2*k) * 2^(n/k)) / (4*n))}; /* Michael Somos, Jun 03 2002 */

Formula

a(n) = (A000013(n) + 2^floor(n/2))/2.

Extensions

Better description from Christian G. Bower
More terms from David W. Wilson, Jan 13 2000

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

A000016 a(n) is the number of distinct (infinite) output sequences from binary n-stage shift register which feeds back the complement of the last stage.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 6, 10, 16, 30, 52, 94, 172, 316, 586, 1096, 2048, 3856, 7286, 13798, 26216, 49940, 95326, 182362, 349536, 671092, 1290556, 2485534, 4793492, 9256396, 17895736, 34636834, 67108864, 130150588, 252645136, 490853416
Offset: 0

Views

Author

Keywords

Comments

Also a(n+1) = number of distinct (infinite) output sequences from binary n-stage shift register which feeds back the complement of the sum of its contents. E.g., for n=5 there are 6 such sequences.
Also a(n+1) = number of binary vectors (x_1,...x_n) satisfying Sum_{i=1..n} i*x_i = 0 (mod n+1) = size of Varshamov-Tenengolts code VT_0(n). E.g., |VT_0(5)| = 6 = a(6).
Number of binary necklaces with an odd number of zeros. - Joerg Arndt, Oct 26 2015
Also, number of subsets of {1,2,...,n-1} which sum to 0 modulo n (cf. A063776). - Max Alekseyev, Mar 26 2016
From Gus Wiseman, Sep 14 2019: (Start)
Also the number of subsets of {1..n} containing n whose mean is an element. For example, the a(1) = 1 through a(8) = 16 subsets are:
1 2 3 4 5 6 7 8
123 234 135 246 147 258
345 456 357 468
12345 1236 567 678
1456 2347 1348
23456 2567 1568
12467 3458
13457 3678
34567 12458
1234567 14578
23578
24568
45678
123468
135678
2345678
(End)
Number of self-dual binary necklaces with 2n beads (cf. A263768, A007147). - Bernd Mulansky, Apr 25 2023

Examples

			For n=3 the 2 output sequences are 000111000111... and 010101...
For n=5 the 4 output sequences are those with periodic parts {0000011111, 0001011101, 0010011011, 01}.
For n=6 there are 6 such sequences.
		

References

  • B. D. Ginsburg, On a number theory function applicable in coding theory, Problemy Kibernetiki, No. 19 (1967), pp. 249-252.
  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967, p. 172.
  • J. Hedetniemi and K. R. Hutson, Equilibrium of shortest path load in ring network, Congressus Numerant., 203 (2010), 75-95. See p. 83.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane, On single-deletion-correcting codes, in Codes and Designs (Columbus, OH, 2000), 273-291, Ohio State Univ. Math. Res. Inst. Publ., 10, de Gruyter, Berlin, 2002.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Stoffer, Delay equations with rapidly oscillating stable periodic solutions, J. Dyn. Diff. Eqs. 20 (1) (2008) 201, eq. (39)

Crossrefs

The main diagonal of table A068009, the left edge of triangle A053633.
Subsets whose mean is an element are A065795.
Dominated by A082550.
Partitions containing their mean are A237984.
Subsets containing n but not their mean are A327477.

Programs

  • Haskell
    a000016 0 = 1
    a000016 n = (`div` (2 * n)) $ sum $
       zipWith (*) (map a000010 oddDivs) (map ((2 ^) . (div n)) $ oddDivs)
       where oddDivs = a182469_row n
    -- Reinhard Zumkeller, May 01 2012
    
  • Maple
    A000016 := proc(n) local d, t; if n = 0 then return 1 else t := 0; for d from 1 to n do if n mod d = 0 and d mod 2 = 1 then t := t + NumberTheory:-Totient(d)* 2^(n/d)/(2*n) fi od; return t fi end:
  • Mathematica
    a[0] = 1; a[n_] := Sum[Mod[k, 2] EulerPhi[k]*2^(n/k)/(2*n), {k, Divisors[n]}]; Table[a[n], {n, 0, 35}](* Jean-François Alcover, Feb 17 2012, after Pari *)
  • PARI
    a(n)=if(n<1,n >= 0,sumdiv(n,k,(k%2)*eulerphi(k)*2^(n/k))/(2*n));
    
  • Python
    from sympy import totient, divisors
    def A000016(n): return sum(totient(d)<>(~n&n-1).bit_length(),generator=True))//n if n else 1 # Chai Wah Wu, Feb 21 2023

Formula

a(n) = Sum_{odd d divides n} (phi(d)*2^(n/d))/(2*n), n>0.
a(n) = A063776(n)/2.
a(n) = 2^(n-1) - A327477(n). - Gus Wiseman, Sep 14 2019

Extensions

More terms from Michael Somos, Dec 11 1999
Showing 1-10 of 45 results. Next