A029744
Numbers of the form 2^n or 3*2^n.
Original entry on oeis.org
1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576, 32768, 49152, 65536, 98304, 131072, 196608, 262144, 393216, 524288, 786432, 1048576, 1572864, 2097152, 3145728, 4194304
Offset: 1
- Vincenzo Librandi, Table of n, a(n) for n = 1..2000
- Spencer Daugherty, Pamela E. Harris, Ian Klein, and Matt McClinton, Metered Parking Functions, arXiv:2406.12941 [math.CO], 2024. See pp. 11, 22.
- Michael De Vlieger, Thomas Scheuerle, Rémy Sigrist, N. J. A. Sloane, and Walter Trump, The Binary Two-Up Sequence, arXiv:2209.04108 [math.CO], Sep 11 2022.
- David Eppstein, Making Change in 2048, arXiv:1804.07396 [cs.DM], 2018.
- Guo-Niu Han, Enumeration of Standard Puzzles. [Cached copy]
- John P. McSorley and Alan H. Schoen, Rhombic tilings of (n,k)-ovals, (n, k, lambda)-cyclic difference sets, and related topics, Discrete Math., 313 (2013), 129-154. - From _N. J. A. Sloane_, Nov 26 2012
- Index entries for linear recurrences with constant coefficients, signature (0,2).
- Index entries for sequences related to necklaces
First differences are in
A016116(n-1).
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with
A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent. There may be minor differences from (s(n)) at the start, and a shift of indices.
A029744 (s(n));
A052955 (s(n)-1),
A027383 (s(n)-2),
A354788 (s(n)-3),
A060482 (s(n)-3);
A136252 (s(n)-3);
A347789 (s(n)-4),
A209721 (s(n)+1),
A209722 (s(n)+2),
A343177 (s(n)+3),
A209723 (s(n)+4);
A354785 (3*s(n)),
A061776 (3*s(n)-6);
A354789 (3*s(n)-7). The first differences of
A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences:
A016116,
A060546,
A117575,
A131572,
A152166,
A158780,
A163403,
A320770. The bisections of
A029744 are
A000079 and
A007283. -
N. J. A. Sloane, Jul 14 2022
-
a029744 n = a029744_list !! (n-1)
a029744_list = 1 : iterate
(\x -> if x `mod` 3 == 0 then 4 * x `div` 3 else 3 * x `div` 2) 2
-- Reinhard Zumkeller, Mar 18 2012
-
1,seq(op([2^i,3*2^(i-1)]),i=1..100); # Robert Israel, Sep 23 2014
-
CoefficientList[Series[(-x^2 - 2*x - 1)/(2*x^2 - 1), {x, 0, 200}], x] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *)
Function[w, DeleteCases[Union@ Flatten@ w, k_ /; k > Max@ First@ w]]@ TensorProduct[{1, 3}, 2^Range[0, 22]] (* Michael De Vlieger, Nov 24 2016 *)
LinearRecurrence[{0,2},{1,2,3},50] (* Harvey P. Dale, Jul 04 2017 *)
-
a(n)=if(n%2,3/2,2)<<((n-1)\2)\1
-
def A029744(n):
if n == 1: return 1
elif n % 2 == 0: return 2**(n//2)
else: return 3 * 2**((n-3)//2) # Karl-Heinz Hofmann, Sep 08 2022
-
(define (A029744 n) (cond ((<= n 1) n) ((even? n) (expt 2 (/ n 2))) (else (* 3 (expt 2 (/ (- n 3) 2)))))) ;; Antti Karttunen, Sep 23 2014
Corrected and extended by Joe Keane (jgk(AT)jgk.org), Feb 20 2000
A006918
a(n) = binomial(n+3, 3)/4 for odd n, n*(n+2)*(n+4)/24 for even n.
Original entry on oeis.org
0, 1, 2, 5, 8, 14, 20, 30, 40, 55, 70, 91, 112, 140, 168, 204, 240, 285, 330, 385, 440, 506, 572, 650, 728, 819, 910, 1015, 1120, 1240, 1360, 1496, 1632, 1785, 1938, 2109, 2280, 2470, 2660, 2870, 3080, 3311, 3542, 3795, 4048, 4324, 4600, 4900, 5200, 5525, 5850, 6201, 6552, 6930
Offset: 0
G.f. = x + 2*x^2 + 5*x^3 + 8*x^4 + 14*x^5 + 20*x^6 + 30*x^7 + 40*x^8 + 55*x^9 + ...
From _Gus Wiseman_, Apr 06 2019: (Start)
The a(4 - 3) = 1 through a(8 - 3) = 14 integer partitions with Durfee square of length 2 are the following (see Franklin T. Adams-Watters's second comment). The Heinz numbers of these partitions are given by A325164.
(22) (32) (33) (43) (44)
(221) (42) (52) (53)
(222) (322) (62)
(321) (331) (332)
(2211) (421) (422)
(2221) (431)
(3211) (521)
(22111) (2222)
(3221)
(3311)
(4211)
(22211)
(32111)
(221111)
The a(0 + 1) = 1 through a(4 + 1) = 14 integer partitions of n into parts of two kinds with at most two parts of each kind are the following (see Franklin T. Adams-Watters's first comment).
()() ()(1) ()(2) ()(3) ()(4)
(1)() (2)() (3)() (4)()
()(11) (1)(2) (1)(3)
(1)(1) ()(21) ()(22)
(11)() (2)(1) (2)(2)
(21)() (22)()
(1)(11) ()(31)
(11)(1) (3)(1)
(31)()
(11)(2)
(1)(21)
(2)(11)
(21)(1)
(11)(11)
The a(6 - 5) = 1 through a(10 - 5) = 14 integer partitions whose third part is 2 are the following (see Emeric Deutsch's comment). The Heinz numbers of these partitions are given by A307373.
(222) (322) (332) (432) (442)
(2221) (422) (522) (532)
(2222) (3222) (622)
(3221) (3321) (3322)
(22211) (4221) (4222)
(22221) (4321)
(32211) (5221)
(222111) (22222)
(32221)
(33211)
(42211)
(222211)
(322111)
(2221111)
(End)
- J. M. Borwein, D. H. Bailey and R. Girgensohn, Experimentation in Mathematics, A K Peters, Ltd., Natick, MA, 2004. x+357 pp. See p. 147.
- M. Kac, An example of "counting without counting", Philips Res. Reports, 30 (1975), 20*-22* [Special issue in honour of C. J. Bouwkamp].
- E. V. McLaughlin, Numbers of factorizations in non-unique factorial domains, Senior Thesis, Allegeny College, Meadville, PA, 2004.
- K. B. Reid and L. W. Beineke "Tournaments", pp. 169-204 in L. W. Beineke and R. J. Wilson, editors, Selected Topics in Graph Theory, Academic Press, NY, 1978, p. 186, Theorem 6.11.
- 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. 1, 2nd ed., 2012, Exercise 4.16, pp. 530, 552.
- W. A. Whitworth, DCC Exercises in Choice and Chance, Stechert, NY, 1945, p. 33.
- T. D. Noe, Table of n, a(n) for n = 0..1000
- Jean-Luc Baril, Alexander Burstein, and Sergey Kirgizov, Pattern statistics in faro words and permutations, arXiv:2010.06270 [math.CO], 2020.
- David J. Broadhurst, On the enumeration of irreducible k-fold Euler sums and their roles in knot theory and field theory, arXiv:hep-th/9604128, 1996.
- David Broadhurst and Xavier Roulleau, Number of partitions of modular integers, arXiv:2502.19523 [math.NT], 2025. See p. 19.
- Yuriy Choliy and Andrew V. Sills, A formula for the partition function that “counts”, Preprint 2015.
- L. Colmenarejo, Combinatorics on several families of Kronecker coefficients related to plane partitions, arXiv:1604.00803 [math.CO], 2016. See Table 1 p. 5.
- S. J. Cyvin et al., Polygonal systems including the corannulene and coronene homologs: novel applications of Pólya's theorem, Z. Naturforsch., 52a (1997), 867-873.
- Steven Edwards and William Griffiths, Generalizations of Delannoy and cross polytope numbers, Fib. Q., Vol. 55, No. 4 (2017), pp. 356-366.
- B. G. Eke, Monotonic triads, Discrete Math., Vol. 9, No. 4 (1974), pp. 359-363. MR0354390 (50 #6869)
- Irene Erazo, John López, and Carlos Trujillo, A combinatorial problem that arose in integer B_3 Sets, Revista Colombiana de Matemáticas, Vol. 53, No. 2 (2019), pp. 195-203.
- Juan B. Gil and Jessica A. Tomasko, Pattern-avoiding even and odd Grassmannian permutations, arXiv:2207.12617 [math.CO], 2022.
- John Golden and Marcus Spradlin, Collinear and Soft Limits of Multi-Loop Integrands in N= 4 Yang-Mills, arXiv preprint arXiv:1203.1915 [hep-th], 2012. - From _N. J. A. Sloane_, Sep 14 2012
- Michele Graffeo, Sergej Monavari, Riccardo Moschetti, and Andrea T. Ricolfi, Enumeration of partitions via socle reduction, arXiv:2501.10267 [math.CO], 2025. See p. 40.
- Brian Hopkins and Aram Tangboonduangjit, Water Cells in Compositions of 1s and 2s, arXiv:2412.11528 [math.CO], 2024. See p. 3.
- Mohammed L. Nadji, Moussa Ahmia, Daniel F. Checa, and José L. Ramírez, Arndt Compositions with Restricted Parts, Palindromes, and Colored Variants, J. Int. Seq. (2025) Vol. 28, Issue 3, Article 25.3.6. See p. 11.
- Brian O'Sullivan and Thomas Busch, Spontaneous emission in ultra-cold spin-polarised anisotropic Fermi seas, arXiv 0810.0231v1 [quant-ph], 2008. [Eq 10b, lambda=2]
- Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
- Index entries for sequences related to Lyndon words.
-
a006918 n = a006918_list !! n
a006918_list = scanl (+) 0 a008805_list
-- Reinhard Zumkeller, Feb 01 2013
-
[Floor(Binomial(n+4, 4)/(n+4))-Floor((n+2)/8)*(1+(-1)^n)/2: n in [0..60]]; // Vincenzo Librandi, Nov 10 2014
-
with(combstruct):ZL:=[st,{st=Prod(left,right),left=Set(U,card=r),right=Set(U,card=r),U=Sequence(Z,card>=3)}, unlabeled]: subs(r=1,stack): seq(count(subs(r=2,ZL),size=m),m=11..58) ; # Zerinvary Lajos, Mar 09 2007
A006918 := proc(n)
if type(n,'even') then
n*(n+2)*(n+4)/24 ;
else
binomial(n+3,3)/4 ;
fi ;
end proc: # R. J. Mathar, May 17 2016
-
f[n_]:=If[EvenQ[n],(n(n+2)(n+4))/24,Binomial[n+3,3]/4]; Join[{0},Array[f,60]] (* Harvey P. Dale, Apr 20 2011 *)
durf[ptn_]:=Length[Select[Range[Length[ptn]],ptn[[#]]>=#&]];
Table[Length[Select[IntegerPartitions[n],durf[#]==2&]],{n,0,30}] (* Gus Wiseman, Apr 06 2019 *)
-
{ parttrees(n)=local(pt,k,nk); if (n%2==0, pt=(n/2+1)^2, pt=ceil(n/2)*(ceil(n/2)+1)); pt+=floor(n/2); for (x=1,floor(n/2),pt+=floor(x/2)+floor((n-x)/2)); if (n%2==0 && n>2, pt-=floor(n/4)); k=1; while (3*k<=n, for (x=k,floor((n-k)/2), pt+=floor(k/2); if (x!=k, pt+=floor(x/2)); if ((n-x-k)!=k && (n-x-k)!=x, pt+=floor((n-x-k)/2))); k++); pt }
-
{a(n) = n += 2; (n^3 - n * (2-n%2)^2) / 24}; /* Michael Somos, Aug 15 2009 */
A014580
Binary irreducible polynomials (primes in the ring GF(2)[X]), evaluated at X=2.
Original entry on oeis.org
2, 3, 7, 11, 13, 19, 25, 31, 37, 41, 47, 55, 59, 61, 67, 73, 87, 91, 97, 103, 109, 115, 117, 131, 137, 143, 145, 157, 167, 171, 185, 191, 193, 203, 211, 213, 229, 239, 241, 247, 253, 283, 285, 299, 301, 313, 319, 333, 351, 355, 357, 361, 369, 375
Offset: 1
David Petry (petry(AT)accessone.com)
x^4 + x^3 + 1 -> 16+8+1 = 25. Or, x^4 + x^3 + 1 -> 11001 (binary) = 25 (decimal).
Number of degree-n irreducible polynomials:
A001037, see also
A000031.
Table of irreducible factors of n:
A256170.
Sequences analyzing the difference between factorization into GF(2)[X] irreducibles and ordinary prime factorization of the corresponding integer:
A234741,
A234742,
A235032,
A235033,
A235034,
A235035,
A235040,
A236850,
A325386,
A325559,
A325560,
A325563,
A325641,
A325642,
A325643.
See
A115871 for sequences related to cross-domain congruences.
-
fQ[n_] := Block[{ply = Plus @@ (Reverse@ IntegerDigits[n, 2] x^Range[0, Floor@ Log2@ n])}, ply == Factor[ply, Modulus -> 2] && n != 2^Floor@ Log2@ n]; fQ[2] = True; Select[ Range@ 378, fQ] (* Robert G. Wilson v, Aug 12 2011 *)
Reap[Do[If[IrreduciblePolynomialQ[IntegerDigits[n, 2] . x^Reverse[Range[0, Floor[Log[2, n]]]], Modulus -> 2], Sow[n]], {n, 2, 1000}]][[2, 1]] (* Jean-François Alcover, Nov 21 2016 *)
-
is(n)=polisirreducible(Pol(binary(n))*Mod(1,2)) \\ Charles R Greathouse IV, Mar 22 2013
A027375
Number of aperiodic binary strings of length n; also number of binary sequences with primitive period n.
Original entry on oeis.org
0, 2, 2, 6, 12, 30, 54, 126, 240, 504, 990, 2046, 4020, 8190, 16254, 32730, 65280, 131070, 261576, 524286, 1047540, 2097018, 4192254, 8388606, 16772880, 33554400, 67100670, 134217216, 268419060, 536870910, 1073708010, 2147483646, 4294901760
Offset: 0
a(3) = 6 = |{ 001, 010, 011, 100, 101, 110 }|. - corrected by _Geoffrey Critzer_, Dec 07 2014
- J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 13. - From N. J. A. Sloane, Oct 26 2012
- E. R. Berlekamp, Algebraic Coding Theory, McGraw-Hill, NY, 1968, p. 84.
- Blanchet-Sadri, Francine. Algorithmic combinatorics on partial words. Chapman & Hall/CRC, Boca Raton, FL, 2008. ii+385 pp. ISBN: 978-1-4200-6092-8; 1-4200-6092-9 MR2384993 (2009f:68142). See p. 164.
- S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967.
- Mark I. Krusemeyer, George T. Gilbert, Loren C. Larson, A Mathematical Orchard, Problems and Solutions, MAA, 2012, Problem 128, pp. 225-227.
- T. D. Noe, Table of n, a(n) for n = 0..300
- J.-P. Allouche, Note on the transcendence of a generating function. In A. Laurincikas and E. Manstavicius, editors, Proceedings of the Palanga Conference for the 75th birthday of Prof. Kubilius, New trends in Probab. and Statist., Vol. 4, pages 461-465, 1997.
- B. Chaffin, J. P. Linderman, N. J. A. Sloane and Allan Wilks, On Curling Numbers of Integer Sequences, arXiv:1212.6102 [math.CO], Dec 25 2012.
- B. Chaffin, J. P. Linderman, N. J. A. Sloane and Allan Wilks, On Curling Numbers of Integer Sequences, Journal of Integer Sequences, Vol. 16 (2013), Article 13.4.3.
- John D. Cook, Counting primitive bit strings (2014).
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 85.
- Guilhem Gamard, Gwenaël Richomme, Jeffrey Shallit and Taylor J. Smith, Periodicity in rectangular arrays, arXiv:1602.06915 [cs.DM], 2016; Information Processing Letters 118 (2017) 58-63. See Table 1.
- O. Georgiou, C. P. Dettmann and E. G. Altmann, Faster than expected escape for a class of fully chaotic maps, arXiv preprint arXiv:1207.7000 [nlin.CD], 2012. - From _N. J. A. Sloane_, Dec 23 2012
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- David W. Lyons, Cristina Mullican, Adam Rilatt, and Jack D. Putnam, Werner states from diagrams, arXiv:2302.05572 [quant-ph], 2023.
- 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
- M. B. Nathanson, Primitive sets and Euler phi function for subsets of {1,2,...,n}, arXiv:math/0608150 [math.NT], 2006-2007.
- P. Pongsriiam, Relatively Prime Sets, Divisor Sums, and Partial Sums, arXiv:1306.4891 [math.NT], 2013 and J. Int. Seq. 16 (2013) #13.9.1.
- P. Pongsriiam, A remark on relative prime sets, arXiv:1306.2529 [math.NT], 2013.
- P. Pongsriiam, A remark on relative prime sets, Integers 13 (2013), A49.
- R. C. Read, Combinatorial problems in the theory of music, Disc. Math. 167/168 (1997) 543-551, sequence A(n).
- M. Tang, Relatively Prime Sets and a Phi Function for Subsets of {1, 2, ... , n}, J. Int. Seq. 13 (2010) # 10.7.6.
- László Tóth, Menon-type identities concerning subsets of the set {1,2,...,n}, arXiv:2109.06541 [math.NT], 2021.
A038199 and
A056267 are essentially the same sequence with different initial terms.
-
a027375 n = n * a001037 n -- Reinhard Zumkeller, Feb 01 2013
-
with(numtheory): A027375 :=n->add( mobius(d)*2^(n/d), d = divisors(n)); # N. J. A. Sloane, Sep 25 2012
-
Table[ Apply[ Plus, MoebiusMu[ n / Divisors[n] ]*2^Divisors[n] ], {n, 1, 32} ]
a[0]=0; a[n_] := DivisorSum[n, MoebiusMu[n/#]*2^#&]; Array[a, 40, 0] (* Jean-François Alcover, Dec 01 2015 *)
-
a(n) = sumdiv(n,d,moebius(n\d)*2^d);
-
from sympy import mobius, divisors
def a(n): return sum(mobius(d)*2**(n//d) for d in divisors(n))
print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 28 2017
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
a(5) = 3 corresponding to the necklaces 00001, 00111, 01011.
a(6) = 5 from 000001, 000011, 000101, 000111, 001011.
- 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).
- G. C. Greubel, Table of n, a(n) for n = 0..3320 (terms 0..200 from T. D. Noe)
- Joerg Arndt, Matters Computational (The Fxtbook), p.408 and p.848.
- L. Carlitz, A theorem of Dickson on irreducible polynomials, Proc. Amer. Math. Soc. 3, (1952). 693-700.
- CombOS - Combinatorial Object Server, Generate necklaces, Lyndon words, chord diagrams, and relatives
- J. Demongeot, M. Noual and S. Sene, On the number of attractors of positive and negative threshold Boolean automata circuits, hal-00647877 preprint (2009). [From Mathilde Noual (mathilde.noual(AT)ens-lyon.fr), Mar 03 2009]
- N. J. Fine, Classes of periodic sequences, Illinois J. Math., 2 (1958), 285-302.
- H. L. Fisher, Letter to N. J. A. Sloane, Mar 16 1989
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- R. W. Hall and P. Klingsberg, Asymmetric rhythms and tiling canons, Amer. Math. Monthly, 113 (2006), 887-896.
- J. E. Iglesias, A formula for the number of closest packings of equal spheres having a given repeat period, Z. Krist. 155 (1981) 121-127, Table 2.
- J. E. Iglesias, Enumeration of polytypes MX and MX_2 through the use of the symmetry of the Zhadanov symbol, Acta Cryst. A 62 (3) (2006) 178-194, Table 1.
- Veronika Irvine, Lace Tessellations: A mathematical model for bobbin lace and an exhaustive combinatorial search for patterns, PhD Dissertation, University of Victoria, 2016.
- A. A. Kulkarni, N. Kiyavash and R. Sreenivas, On the Varshamov-Tenengolts Construction on Binary Strings, 2013.
- R. P. Loh, A. G. Shannon, A. F. Horadam, Divisibility Criteria and Sequence Generators Associated with Fermat Coefficients, Preprint, 1980.
- R. M. May, Simple mathematical models with very complicated dynamics, Nature, 261 (Jun 10, 1976), 459-467.
- N. Metropolis, M. L. Stein and P. R. Stein, On finite limit sets for transformations on the unit interval, J. Combin. Theory, A 15 (1973), 25-44; reprinted in P. Cvitanovic, ed., Universality in Chaos, Hilger, Bristol, 1986, pp. 187-206.
- H. Meyn and W. Götz, Self-reciprocal polynomials over finite fields, Séminaire Lotharingien de Combinatoire, B21d (1989), 8 pp.
- Simon Michalowsky, Bahman Gharesifard, Christian Ebenbauer, A Lie bracket approximation approach to distributed optimization over directed graphs, arXiv:1711.05486 [math.OC], 2017.
- Tilman Piesk, Lists of the three sets of necklaces for n=1..12
- R. Pries and C. Weir, The Ekedahl-Oort type of Jacobians of Hermitian curves, arXiv preprint arXiv:1302.6261 [math.NT], 2013.
- Frank Ruskey, Number of q-ary Lyndon words with given trace mod q
- Frank Ruskey, Number of Lyndon words over GF(q) with given trace
- N. J. A. Sloane, On single-deletion-correcting codes, arXiv:math/0207197 [math.CO], 2002; 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, On single-deletion-correcting codes
- B. R. Smith, Reducing quadratic forms by kneading sequences, Journal of Integer Sequences, 17 (2014), article 14.11.8.
- P. R. Stein, Letter to N. J. A. Sloane, Jun 02 1971
- J.-Y. Thibon, The cycle enumerator of unimodal permutations, arXiv:math/0102051 [math.CO], 2001.
- Index entries for "core" sequences
- Index entries for sequences related to Lyndon words
- Index entries for sequences related to subset sums modulo m
Very close to
A006788 [Fisher, 1989].
-
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;
-
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 *)
-
A000048(n) = sumdiv(n,d,(d%2)*(moebius(d)*2^(n/d)))/(2*n) \\ Michael B. Porter, Nov 09 2009
-
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
-
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
A001840
Expansion of g.f. x/((1 - x)^2*(1 - x^3)).
Original entry on oeis.org
0, 1, 2, 3, 5, 7, 9, 12, 15, 18, 22, 26, 30, 35, 40, 45, 51, 57, 63, 70, 77, 84, 92, 100, 108, 117, 126, 135, 145, 155, 165, 176, 187, 198, 210, 222, 234, 247, 260, 273, 287, 301, 315, 330, 345, 360, 376, 392, 408, 425, 442, 459, 477, 495, 513, 532, 551, 570, 590
Offset: 0
G.f. = x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 9*x^6 + 12*x^7 + 15*x^8 + 18*x^9 + ...
1+2+3=6=t(3), 2+3+5=t(4), 5+7+9=t(5).
[n] a(n)
--------
[1] 1
[2] 2
[3] 3
[4] 1 + 4
[5] 2 + 5
[6] 3 + 6
[7] 1 + 4 + 7
[8] 2 + 5 + 8
[9] 3 + 6 + 9
a(7) = floor(2/3) +floor(3/3) +floor(4/3) +floor(5/3) +floor(6/3) +floor(7/3) +floor(8/3) +floor(9/3) = 12. - _Bruno Berselli_, Aug 29 2013
- Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 73, problem 25.
- Ulrich Faigle, Review of Gerhard Post and G.J. Woeginger, Sports tournaments, home-away assignments and the break minimization problem, MR2224983(2007b:90134), 2007.
- Hansraj Gupta, Partitions of j-partite numbers into twelve or a smaller number of parts. Collection of articles dedicated to Professor P. L. Bhatnagar on his sixtieth birthday. Math. Student 40 (1972), 401-441 (1974).
- Richard K. Guy, A problem of Zarankiewicz, in P. Erdős and G. Katona, editors, Theory of Graphs (Proceedings of the Colloquium, Tihany, Hungary), Academic Press, NY, 1968, pp. 119-150, (p. 126, divided by 2).
- 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).
- T. D. Noe, Table of n, a(n) for n = 0..1000
- Chwas Ahmed, Paul Martin, and Volodymyr Mazorchuk, On the number of principal ideals in d-tonal partition monoids, arXiv preprint arXiv:1503.06718 [math.CO], 2015.
- Gert Almkvist, Asymptotic formulas and generalized Dedekind sums, Exper. Math., 7 (No. 4, 1998), pp. 343-359.
- David J. Broadhurst, On the enumeration of irreducible k-fold Euler sums and their roles in knot theory and field theory, arXiv:hep-th/9604128, 1996.
- David Broadhurst and Xavier Roulleau, Number of partitions of modular integers, arXiv:2502.19523 [math.NT], 2025. See p. 19.
- Cristian Cobeli, Aaditya Raghavan, and Alexandru Zaharescu, On the central ball in a translation invariant involutive field, arXiv:2408.01864 [math.NT], 2024. See p. 7.
- Neville de Mestre and John Baker, Pebbles, Ducks and Other Surprises, Australian Maths. Teacher, Vol. 48, No 3, 1992, pp. 4-7.
- Peter M. Chema, Illustration of first 27 terms as corners of a double hexagon spiral from 0
- H. Gupta, Partitions of j-partite numbers into twelve or a smaller number of parts, Math. Student 40 (1972), 401-441 (1974). [Annotated scanned copy]
- Richard K. Guy, A problem of Zarankiewicz, Research Paper No. 12, Dept. of Math., Univ. Calgary, Jan. 1967. [Annotated and scanned copy, with permission]
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 207.
- Clark Kimberling, A Combinatorial Classification of Triangle Centers on the Line at Infinity, J. Int. Seq., Vol. 22 (2019), Article 19.5.4.
- Clark Kimberling and John E. Brown, Partial Complements and Transposable Dispersions, J. Integer Seqs., Vol. 7, 2004.
- R. P. Loh, A. G. Shannon, and A. F. Horadam, Divisibility Criteria and Sequence Generators Associated with Fermat Coefficients, Preprint, 1980.
- Pieter Moree, The formal series Witt transform, Discr. Math. no. 295 vol. 1-3 (2005) 143-160.
- Brian O'Sullivan and Thomas Busch, Spontaneous emission in ultra-cold spin-polarised anisotropic Fermi seas, arXiv 0810.0231v1 [quant-ph], 2008. [Eq 8a, lambda=3]
- Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
- Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992.
- Gerhard Post and G. J. Woeginger, Sports tournaments, home-away assignments and the break minimization problem, Discrete Optimization 3, pp. 165-173, 2006.
- Michael Somos, Somos Polynomials.
- Gary E. Stevens, A Connell-Like Sequence, J. Integer Seqs., 1 (1998), Article 98.1.4.
- Andrei K. Svinin, On some class of sums, arXiv:1610.05387 [math.CO], 2016. See p. 7.
- Eric Weisstein's World of Mathematics, Lower Matching Number.
- Eric Weisstein's World of Mathematics, Triangular Grid Graph.
- Eric Weisstein's World of Mathematics, Triangular Honeycomb King Graph.
- Index entries for sequences related to Lyndon words.
- Index entries for two-way infinite sequences.
- Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
Ordered union of triangular matchstick numbers
A045943 and generalized pentagonal numbers
A001318.
A337483 counts either weakly increasing or weakly decreasing triples.
A337484 counts neither strictly increasing nor strictly decreasing triples.
-
a001840 n = a001840_list !! n
a001840_list = scanl (+) 0 a008620_list
-- Reinhard Zumkeller, Apr 16 2012
-
[ n le 2 select n else n*(n+1)/2-Self(n-1)-Self(n-2): n in [1..58] ]; // Klaus Brockhaus, Oct 01 2009
-
A001840 := n->floor((n+1)*(n+2)/6);
A001840:=-1/((z**2+z+1)*(z-1)**3); # conjectured (correctly) by Simon Plouffe in his 1992 dissertation
seq(floor(binomial(n-1,2)/3), n=3..61); # Zerinvary Lajos, Jan 12 2009
A001840 := n -> add(k, k = select(k -> k mod 3 = n mod 3, [$1 .. n])): seq(A001840(n), n = 0 .. 58); # Peter Luschny, Jul 06 2011
-
a[0]=0; a[1]=1; a[n_]:= a[n]= n(n+1)/2 -a[n-1] -a[n-2]; Table[a[n], {n,0,100}]
f[n_] := Floor[(n + 1)(n + 2)/6]; Array[f, 59, 0] (* Or *)
CoefficientList[ Series[ x/((1 + x + x^2)*(1 - x)^3), {x, 0, 58}], x] (* Robert G. Wilson v *)
a[ n_] := With[{m = If[ n < 0, -3 - n, n]}, SeriesCoefficient[ x /((1 - x^3) (1 - x)^2), {x, 0, m}]]; (* Michael Somos, Jul 11 2011 *)
LinearRecurrence[{2,-1,1,-2,1},{0,1,2,3,5},60] (* Harvey P. Dale, Jul 25 2011 *)
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n+4,{3}],#[[1]]<#[[2]]&[[1]]<#[[3]]&]],{n,0,15}] (* Gus Wiseman, Oct 05 2020 *)
-
{a(n) = (n+1) * (n+2) \ 6}; /* Michael Somos, Feb 11 2004 */
-
[binomial(n, 2) // 3 for n in range(2, 61)] # Zerinvary Lajos, Dec 01 2009
A328596
Numbers whose reversed binary expansion is a Lyndon word (aperiodic necklace).
Original entry on oeis.org
1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 44, 48, 52, 56, 58, 60, 62, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 128, 144, 152, 160, 164, 168, 172, 176, 180, 184, 188, 192, 200, 208, 212, 216, 218, 220, 224
Offset: 1
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
32: 100000 ~ {6}
40: 101000 ~ {4,6}
44: 101100 ~ {3,4,6}
48: 110000 ~ {5,6}
52: 110100 ~ {3,5,6}
56: 111000 ~ {4,5,6}
58: 111010 ~ {2,4,5,6}
-
aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
Select[Range[100],aperQ[Reverse[IntegerDigits[#,2]]]&&neckQ[Reverse[IntegerDigits[#,2]]]&]
A275692
Numbers k such that every rotation of the binary digits of k is less than k.
Original entry on oeis.org
0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1
6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
1: 1 ~ {1}
2: 10 ~ {2}
4: 100 ~ {3}
6: 110 ~ {2,3}
8: 1000 ~ {4}
12: 1100 ~ {3,4}
14: 1110 ~ {2,3,4}
16: 10000 ~ {5}
20: 10100 ~ {3,5}
24: 11000 ~ {4,5}
26: 11010 ~ {2,4,5}
28: 11100 ~ {3,4,5}
30: 11110 ~ {2,3,4,5}
32: 100000 ~ {6}
40: 101000 ~ {4,6}
48: 110000 ~ {5,6}
50: 110010 ~ {2,5,6}
52: 110100 ~ {3,5,6}
56: 111000 ~ {4,5,6}
58: 111010 ~ {2,4,5,6}
(End)
Numbers whose binary expansion is aperiodic are
A328594.
Numbers whose reversed binary expansion is a necklace are
A328595.
Length of Lyndon factorization of binary expansion is
A211100.
Length of co-Lyndon factorization of binary expansion is
A329312.
Length of Lyndon factorization of reversed binary expansion is
A329313.
Length of co-Lyndon factorization of reversed binary expansion is
A329326.
All of the following pertain to compositions in standard order (
A066099):
- Rotational symmetries are counted by
A138904.
- Constant compositions are
A272919.
- Lyndon compositions are
A275692 (this sequence).
- Co-Lyndon compositions are
A326774.
- Co-Lyndon factorizations are counted by
A333765.
- Lyndon factorizations are counted by
A333940.
-
filter:= proc(n) local L, k;
L:= convert(convert(n,binary),string);
for k from 1 to length(L)-1 do
if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
od;
true
end proc:
select(filter, [$0..1000]);
-
filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
-
def ok(n):
b = bin(n)[2:]
return all(b[i:] + b[:i] < b for i in range(1, len(b)))
print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022
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
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.
- 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)
- Seiichi Manyama, Table of n, a(n) for n = 0..3334 (first 201 terms from T. D. Noe)
- Nicolás Álvarez, Victória Becher, Martín Mereb, Ivo Pajor, and Carlos Miguel Soto, On extremal factors of de Bruijn-like graphs, Univ. Buenos Aires (Argentina 2023). See also arXiv:2308.16257 [math.CO], 2023. See references.
- Joshua P. Bowman, Compositions with an Odd Number of Parts, and Other Congruences, J. Int. Seq (2024) Vol. 27, Art. 24.3.6. See p. 17.
- A. E. Brouwer, The Enumeration of Locally Transitive Tournaments, Math. Centr. Report ZW138, Amsterdam, 1980.
- S. Butenko, P. Pardalos, I. Sergienko, V. P. Shylo and P. Stetsyuk, Estimating the size of correcting codes using extremal graph problems, Optimization, 227-243, Springer Optim. Appl., 32, Springer, New York, 2009.
- P. J. Cameron, Sequences realized by oligomorphic permutation groups, J. Integ. Seqs. Vol. 3 (2000), #00.1.5.
- Sébastien Designolle, Tamás Vértesi, and Sebastian Pokutta, Symmetric multipartite Bell inequalities via Frank-Wolfe algorithms, arXiv:2310.20677 [quant-ph], 2023.
- T. M. A. Fink, Exact dynamics of the critical Kauffman model with connectivity one, arXiv:2302.05314 [cond-mat.stat-mech], 2023.
- R. W. Hall and P. Klingsberg, Asymmetric rhythms and tiling canons, Amer. Math. Monthly, 113 (2006), 887-896.
- A. A. Kulkarni, N. Kiyavash and R. Sreenivas, On the Varshamov-Tenengolts Construction on Binary Strings, 2013.
- E. M. Palmer and R. W. Robinson, Enumeration of self-dual configurations, Pacific J. Math., 110 (1984), 203-221.
- R. Pries and C. Weir, The Ekedahl-Oort type of Jacobians of Hermitian curves, arXiv preprint arXiv:1302.6261 [math.NT], 2013.
- N. J. A. Sloane, On single-deletion-correcting codes
- N. J. A. Sloane, Challenge Problems: Independent Sets in Graphs
- Yan Bo Ti, Gabriel Verret, and Lukas Zobernig, Abelian Varieties with p-rank Zero, arXiv:2203.08401 [math.NT], 2022.
- Antonio Vera López, Luis Martínez, Antonio Vera Pérez, Beatriz Vera Pérez, and Olga Basova, Combinatorics related to Higman's conjecture I: Parallelogramic digraphs and dispositions, Linear Algebra Appl. 530, 414-444 (2017).
- Index entries for sequences related to tournaments
- Index entries for sequences related to necklaces
- Index entries for sequences related to subset sums modulo m
The main diagonal of table
A068009, the left edge of triangle
A053633.
Subsets whose mean is an element are
A065795.
Partitions containing their mean are
A237984.
Subsets containing n but not their mean are
A327477.
-
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
-
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:
-
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 *)
-
a(n)=if(n<1,n >= 0,sumdiv(n,k,(k%2)*eulerphi(k)*2^(n/k))/(2*n));
-
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
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
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 + ...
- 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).
- Seiichi Manyama, Table of n, a(n) for n = 0..3334 (first 201 terms from T. D. Noe)
- Nicolás Álvarez, Victória Becher, Martín Mereb, Ivo Pajor, and Carlos Miguel Soto, On extremal factors of de Bruijn-like graphs, Univ. Buenos Aires (Argentina 2023). See also arXiv:2308.16257 [math.CO], 2023. See references.
- Joerg Arndt, Matters Computational (The Fxtbook), p. 151, p. 408.
- Raghav Bhutani and Frederick Saia, Replacement dynamics of binary quadratic forms, arXiv:2508.05816 [math.NT], 2025. See p. 6.
- Henry Bottomley, Initial terms of A000011 and A000013
- Zachary E. Chin and Isaac L. Chuang, The quantum trajectory sensing problem and its solution, arXiv:2410.00893 [quant-ph], 2024. See p. 19.
- N. J. Fine, Classes of periodic sequences, Illinois J. Math., 2 (1958), 285-302.
- E. N. Gilbert and J. Riordan, Symmetry types of periodic sequences, Illinois J. Math., 5 (1961), 657-665.
- Darij Grinberg and Peter Mao, Necklaces over a group with identity product, arXiv:2405.08937 [math.CO], 2024. See pp. 15, 22.
- Karyn McLellan, Periodic coefficients and random Fibonacci sequences, Electronic Journal of Combinatorics, 20(4), 2013, #P32.
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc.
- Frank Ruskey, Necklaces, Lyndon words, De Bruijn sequences, etc. [Cached copy, with permission, pdf format only]
- N. J. A. Sloane, On single-deletion-correcting codes
- N. J. A. Sloane, On single-deletion-correcting codes, arXiv:math/0207197 [math.CO], 2002; 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, Maple code for this and related sequences
- Index entries for sequences related to necklaces
-
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
-
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;
-
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 *)
-
{a(n) = if( n<1, n==0, sumdiv(n, k, eulerphi(2*k) * 2^(n/k)) / (2*n))}; /* Michael Somos, Oct 20 1999 */
-
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
Comments