[go: up one dir, main page]

login
Search: a003056 -id:a003056
     Sort: relevance | references | number | modified | created      Format: long | short | data
Expansion of Product_{m >= 1} (1 + x^m); number of partitions of n into distinct parts; number of partitions of n into odd parts.
(Formerly M0281 N0100)
+0
1521
1, 1, 1, 2, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 22, 27, 32, 38, 46, 54, 64, 76, 89, 104, 122, 142, 165, 192, 222, 256, 296, 340, 390, 448, 512, 585, 668, 760, 864, 982, 1113, 1260, 1426, 1610, 1816, 2048, 2304, 2590, 2910, 3264, 3658, 4097, 4582, 5120, 5718, 6378
OFFSET
0,4
COMMENTS
Partitions into distinct parts are sometimes called "strict partitions".
The number of different ways to run up a staircase with m steps, taking steps of odd sizes (or taking steps of distinct sizes), where the order is not relevant and there is no other restriction on the number or the size of each step taken is the coefficient of x^m.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
The result that number of partitions of n into distinct parts = number of partitions of n into odd parts is due to Euler.
Bijection: given n = L1* 1 + L2*3 + L3*5 + L7*7 + ..., a partition into odd parts, write each Li in binary, Li = 2^a1 + 2^a2 + 2^a3 + ... where the aj's are all different, then expand n = (2^a1 * 1 + ...)*1 + ... by removing the brackets and we get a partition into distinct parts. For the reverse operation, just keep splitting any even number into halves until no evens remain.
Euler transform of period 2 sequence [1,0,1,0,...]. - Michael Somos, Dec 16 2002
Number of different partial sums 1+[1,2]+[1,3]+[1,4]+..., where [1,x] indicates a choice. E.g., a(6)=4, as we can write 1+1+1+1+1+1, 1+2+3, 1+2+1+1+1, 1+1+3+1. - Jon Perry, Dec 31 2003
a(n) is the sum of the number of partitions of x_j into at most j parts, where j is the index for the j-th triangular number and n-T(j)=x_j. For example; a(12)=partitions into <= 4 parts of 12-T(4)=2 + partitions into <= 3 parts of 12-T(3)=6 + partitions into <= 2 parts of 12-T(2)=9 + partitions into 1 part of 12-T(1)=11 = (2)(11) + (6)(51)(42)(411)(33)(321)(222) + (9)(81)(72)(63)(54)+(11) = 2+7+5+1 = 15. - Jon Perry, Jan 13 2004
Number of partitions of n where if k is the largest part, all parts 1..k are present. - Jon Perry, Sep 21 2005
Jack Grahl and Franklin T. Adams-Watters prove this claim of Jon Perry's by observing that the Ferrers dual of a "gapless" partition is guaranteed to have distinct parts; since the Ferrers dual is an involution, this establishes a bijection between the two sets of partitions. - Allan C. Wechsler, Sep 28 2021
The number of connected threshold graphs having n edges. - Michael D. Barrus (mbarrus2(AT)uiuc.edu), Jul 12 2007
Starting with offset 1 = row sums of triangle A146061 and the INVERT transform of A000700 starting: (1, 0, 1, -1, 1, -1, 1, -2, 2, -2, 2, -3, 3, -3, 4, -5, ...). - Gary W. Adamson, Oct 26 2008
Number of partitions of n in which the largest part occurs an odd number of times and all other parts occur an even number of times. (Such partitions are the duals of the partitions with odd parts.) - David Wasserman, Mar 04 2009
Equals A035363 convolved with A010054. The convolution square of A000009 = A022567 = A000041 convolved with A010054. A000041 = A000009 convolved with A035363. - Gary W. Adamson, Jun 11 2009
Considering all partitions of n into distinct parts: there are A140207(n) partitions of maximal size which is A003056(n), and A051162(n) is the greatest number occurring in these partitions. - Reinhard Zumkeller, Jun 13 2009
Equals left border of triangle A091602 starting with offset 1. - Gary W. Adamson, Mar 13 2010
Number of symmetric unimodal compositions of n+1 where the maximal part appears once. Also number of symmetric unimodal compositions of n where the maximal part appears an odd number of times. - Joerg Arndt, Jun 11 2013
Because for these partitions the exponents of the parts 1, 2, ... are either 0 or 1 (j^0 meaning that part j is absent) one could call these partitions also 'fermionic partitions'. The parts are the levels, that is the positive integers, and the occupation number is either 0 or 1 (like Pauli's exclusion principle). The 'fermionic states' are denoted by these partitions of n. - Wolfdieter Lang, May 14 2014
The set of partitions containing only odd parts forms a monoid under the product described in comments to A047993. - Richard Locke Peterson, Aug 16 2018
Ewell (1973) gives a number of recurrences. - N. J. A. Sloane, Jan 14 2020
a(n) equals the number of permutations p of the set {1,2,...,n+1}, written in one line notation as p = p_1p_2...p_(n+1), satisfying p_(i+1) - p_i <= 1 for 1 <= i <= n, (i.e., those permutations that, when read from left to right, never increase by more than 1) whose major index maj(p) := Sum_{p_i > p_(i+1)} i equals n. For example, of the 16 permutations on 5 letters satisfying p_(i+1) - p_i <= 1, 1 <= i <= 4, there are exactly two permutations whose major index is 4, namely, 5 3 4 1 2 and 2 3 4 5 1. Hence a(4) = 2. See the Bala link in A007318 for a proof. - Peter Bala, Mar 30 2022
Conjecture: Each positive integer n can be written as a_1 + ... + a_k, where a_1,...,a_k are strict partition numbers (i.e., terms of the current sequence) with no one dividing another. This has been verified for n = 1..1350. - Zhi-Wei Sun, Apr 14 2023
Conjecture: For each integer n > 7, a(n) divides none of p(n), p(n) - 1 and p(n) + 1, where p(n) is the number of partitions of n given by A000041. This has been verified for n up to 10^5. - Zhi-Wei Sun, May 20 2023 [Verified for n <= 2*10^6. - Vaclav Kotesovec, May 23 2023]
REFERENCES
Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).
Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17. Zentralblatt MATH, Zbl 1071.05501.
George E. Andrews, The Theory of Partitions, Cambridge University Press, 1998, p. 19.
George E. Andrews, Number Theory, Dover Publications, 1994, Theorem 12-3, pp. 154-5, and (13-1-1) p. 163.
Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; see p. 196.
T. J. I'a. Bromwich, Introduction to the Theory of Infinite Series, Macmillan, 2nd. ed. 1949, p. 116, Problem 18.
Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 99.
William Dunham, The Mathematical Universe, pp. 57-62, J. Wiley, 1994.
Leonhard Euler, De partitione numerorum, Novi commentarii academiae scientiarum Petropolitanae 3 (1750/1), 1753, reprinted in: Commentationes Arithmeticae. (Opera Omnia. Series Prima: Opera Mathematica, Volumen Secundum), 1915, Lipsiae et Berolini, 254-294.
Ian P. Goulden and David M. Jackson, Combinatorial Enumeration, Wiley, N.Y., 1983, (2.5.1).
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 277, Theorems 344, 346.
Carlos J. Moreno and Samuel S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 253.
Srinivasa Ramanujan, Collected Papers, Ed. G. H. Hardy et al., Cambridge 1927; Chelsea, NY, 1962. See Table V on page 309.
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).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..5000 (first 2000 terms from N. J. A. Sloane)
Joerg Arndt, Matters Computational (The Fxtbook), pp. 348-350.
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy], p. 836.
Francesca Aicardi, Matricial formulae for partitions, Functional Analysis and Other Mathematics, Vol. 3, No. 2 (2011), pp. 127-133; arXiv preprint, arXiv:0806.1273 [math.NT], 2008.
George E. Andrews, Euler's "De Partitio Numerorum", Bull. Amer. Math. Soc., 44 (No. 4, 2007), 561-573.
George E. Andrews, The Bhargava-Adiga Summation and Partitions, 2016. See page 4 equation (2.2).
Brennan Benfield and Arindam Roy, Log-concavity And The Multiplicative Properties of Restricted Partition Functions, arXiv:2404.03153 [math.NT], 2024.
Andreas B. G. Blobel, An Asymptotic Form of the Generating Function Prod_{k=1,oo} (1+x^k/k), arXiv:1904.07808 [math.CO], 2019.
Alexander Bors, Michael Giudici, and Cheryl E. Praeger, Documentation for the GAP code file OrbOrd.txt, arXiv:1910.12570 [math.GR], 2019.
Andrés Eduardo Caicedo and Brittany Shelton, Of puzzles and partitions: Introducing Partiti, Mathematics Magazine, Vol. 91, No. 1 (2018), pp. 20-23; arXiv preprint, arXiv:1710.04495 [math.HO], 2017.
Huantian Cao, AutoGF: An Automated System to Calculate Coefficients of Generating Functions, thesis, 2002. [Local copy, with permission]
H. B. C. Darling, Collected Papers of Ramanujan, Table for q(n); n=1 through 100.
Alejandro Erickson and Mark Schurch, Monomer-dimer tatami tilings of square regions, Journal of Discrete Algorithms, Vol. 16 (2012), pp. 258-269; arXiv preprint, arXiv:1110.5103 [math.CO], 2011.
John A. Ewell, Partition recurrences, J. Comb. Theory A, Vol. 14, 125-127, 1973.
Philippe Flajolet and Robert Sedgewick, Analytic Combinatorics, Cambridge University Press, 2009; see pages 48 and 499.
Evangelos Georgiadis, Computing Partition Numbers q(n), Technical Report, February (2009).
Cristiano Husu, The butterfly sequence: the second difference sequence of the numbers of integer partitions with distinct parts, Journal of Number Theory, Vol. 193 (2018), pp. 171-188; arXiv preprint, arXiv:1804.09883 [math.NT], 2018.
Vaclav Kotesovec, Getting wrong limit with Bessel, Mathematica Stack Exchange, Nov 09 2016.
Alain Lascoux, Sylvester's bijection between strict and odd partitions, Discrete Math., Vol. 277, No. 1-3 (2004), pp. 275-278.
Jeremy Lovejoy, The number of partitions into distinct parts modulo powers of 5, Bulletin of the London Mathematical Society, Vol. 35, No. 1 (2003), pp. 41-46; alternative link.
James Mc Laughlin, Andrew V. Sills, and Peter Zimmer, Rogers-Ramanujan-Slater Type Identities, Electronic J. Combinatorics, DS15, 1-59, May 31, 2008; see also arXiv version, arXiv:1901.00946 [math.NT], 2019.
Günter Meinardus, Über Partitionen mit Differenzenbedingungen, Mathematische Zeitschrift (1954/55), Volume 61, page 289-302.
Mircea Merca, Combinatorial interpretations of a recent convolution for the number of divisors of a positive integer, Journal of Number Theory, Volume 160, March 2016, Pages 60-75, function q(n).
Mircea Merca, The Lambert series factorization theorem, The Ramanujan Journal, Vol. 44, No. 2 (2017), pp. 417-435; alternative link.
István Mező, Several special values of Jacobi theta functions arXiv:1106.2703v3 [math.CA], 2011-2013.
Donald J. Newman, A Problem Seminar, pp. 18;93;102-3 Prob. 93 Springer-Verlag NY 1982.
Hieu D. Nguyen and Douglas Taggart, Mining the OEIS: Ten Experimental Conjectures, 2013. Mentions this sequence.
Kimeu Arphaxad Ngwava, Nick Gill, and Ian Short, Nilpotent covers of symmetric groups, arXiv:2005.13869 [math.GR], 2020.
Ed Sandifer, How Euler Did It, Philip Naude's problem.
Zhi-Wei Sun, A representation problem involving strict partition numbers, Question 444761 at MathOverflow, April 14, 2023.
Wikipedia, Glaisher's Theorem.
Mingjia Yang and Doron Zeilberger, Systematic Counting of Restricted Partitions, arXiv:1910.08989 [math.CO], 2019.
Michael P. Zaletel and Roger S. K. Mong, Exact matrix product states for quantum Hall wave functions, Physical Review B, Vol. 86, No. 24 (2012), 245305; arXiv preprint, arXiv:1208.4862 [cond-mat.str-el], 2012. - From N. J. A. Sloane, Dec 25 2012
FORMULA
G.f.: Product_{m>=1} (1 + x^m) = 1/Product_{m>=0} (1-x^(2m+1)) = Sum_{k>=0} Product_{i=1..k} x^i/(1-x^i) = Sum_{n>=0} x^(n*(n+1)/2) / Product_{k=1..n} (1-x^k).
G.f.: Sum_{n>=0} x^n*Product_{k=1..n-1} (1+x^k) = 1 + Sum_{n>=1} x^n*Product_{k>=n+1} (1+x^k). - Joerg Arndt, Jan 29 2011
Product_{k>=1} (1+x^(2k)) = Sum_{k>=0} x^(k*(k+1))/Product_{i=1..k} (1-x^(2i)) - Euler (Hardy and Wright, Theorem 346).
Asymptotics: a(n) ~ exp(Pi l_n / sqrt(3)) / ( 4 3^(1/4) l_n^(3/2) ) where l_n = (n-1/24)^(1/2) (Ayoub).
For n > 1, a(n) = (1/n)*Sum_{k=1..n} b(k)*a(n-k), with a(0)=1, b(n) = A000593(n) = sum of odd divisors of n; cf. A000700. - Vladeta Jovovic, Jan 21 2002
a(n) = t(n, 0), t as defined in A079211.
a(n) = Sum_{k=0..n-1} A117195(n,k) = A117192(n) + A117193(n) for n>0. - Reinhard Zumkeller, Mar 03 2006
a(n) = A026837(n) + A026838(n) = A118301(n) + A118302(n); a(A001318(n)) = A051044(n); a(A090864(n)) = A118303(n). - Reinhard Zumkeller, Apr 22 2006
Expansion of 1 / chi(-x) = chi(x) / chi(-x^2) = f(-x) / phi(x) = f(x) / phi(-x^2) = psi(x) / f(-x^2) = f(-x^2) / f(-x) = f(-x^4) / psi(-x) in powers of x where phi(), psi(), chi(), f() are Ramanujan theta functions. - Michael Somos, Mar 12 2011
G.f. is a period 1 Fourier series which satisfies f(-1 / (1152 t)) = 2^(-1/2) / f(t) where q = exp(2 Pi i t). - Michael Somos, Aug 16 2007
Expansion of q^(-1/24) * eta(q^2) / eta(q) in powers of q.
Expansion of q^(-1/24) 2^(-1/2) f2(t) in powers of q = exp(2 Pi i t) where f2() is a Weber function. - Michael Somos, Oct 18 2007
Given g.f. A(x), then B(x) = x * A(x^3)^8 satisfies 0 = f(B(x), B(x^2)) where f(u, v) = v - u^2 + 16*u*v^2 . - Michael Somos, May 31 2005
Given g.f. A(x), then B(x) = x * A(x^8)^3 satisfies 0 = f(B(x), B(x^3)) where f(u, v) = (u^3 - v) * (u + v^3) - 9 * u^3 * v^3. - Michael Somos, Mar 25 2008
From Evangelos Georgiadis, Andrew V. Sutherland, Kiran S. Kedlaya (egeorg(AT)mit.edu), Mar 03 2009: (Start)
a(0)=1; a(n) = 2*(Sum_{k=1..floor(sqrt(n))} (-1)^(k+1) a(n-k^2)) + sigma(n) where sigma(n) = (-1)^j if (n=(j*(3*j+1))/2 OR n=(j*(3*j-1))/2) otherwise sigma(n)=0 (simpler: sigma = A010815). (End)
From Gary W. Adamson, Jun 13 2009: (Start)
The product g.f. = (1/(1-x))*(1/(1-x^3))*(1/(1-x^5))*...; = (1,1,1,...)*
(1,0,0,1,0,0,1,0,0,1,...)*(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,...) * ...; =
a*b*c*... where a, a*b, a*b*c, ... converge to A000009:
1, 1, 1, 2, 2, 2, 3, 3, 3, 4, ... = a*b
1, 1, 1, 2, 2, 3, 4, 4, 5, 6, ... = a*b*c
1, 1, 1, 2, 2, 3, 4, 5, 6, 7, ... = a*b*c*d
1, 1, 1, 2, 2, 3, 4, 5, 6, 8, ... = a*b*c*d*e
1, 1, 1, 2, 2, 3, 4, 5, 6, 8, ... = a*b*c*d*e*f
... (cf. analogous example in A000041). (End)
a(A004526(n)) = A172033(n). - Reinhard Zumkeller, Jan 23 2010
a(n) = P(n) - P(n-2) - P(n-4) + P(n-10) + P(n-14) + ... + (-1)^m P(n-2p_m) + ..., where P(n) is the partition function (A000041) and p_m = m(3m-1)/2 is the m-th generalized pentagonal number (A001318). - Jerome Malenfant, Feb 16 2011
a(n) = A054242(n,0) = A201377(n,0). - Reinhard Zumkeller, Dec 02 2011
G.f.: 1/2 (-1; x)_{inf} where (a; q)_k is the q-Pochhammer symbol. - Vladimir Reshetnikov, Apr 24 2013
More precise asymptotics: a(n) ~ exp(Pi*sqrt((n-1/24)/3)) / (4*3^(1/4)*(n-1/24)^(3/4)) * (1 + (Pi^2-27)/(24*Pi*sqrt(3*(n-1/24))) + (Pi^4-270*Pi^2-1215)/(3456*Pi^2*(n-1/24))). - Vaclav Kotesovec, Nov 30 2015
a(n) = A067661(n) + A067659(n). Wolfdieter Lang, Jan 18 2016
From Vaclav Kotesovec, May 29 2016: (Start)
a(n) ~ exp(Pi*sqrt(n/3))/(4*3^(1/4)*n^(3/4)) * (1 + (Pi/(48*sqrt(3)) - (3*sqrt(3))/(8*Pi))/sqrt(n) + (Pi^2/13824 - 5/128 - 45/(128*Pi^2))/n).
a(n) ~ exp(Pi*sqrt(n/3) + (Pi/(48*sqrt(3)) - 3*sqrt(3)/(8*Pi))/sqrt(n) - (1/32 + 9/(16*Pi^2))/n) / (4*3^(1/4)*n^(3/4)).
(End)
a(n) = A089806(n)*A010815(floor(n/2)) + a(n-1) + a(n-2) - a(n-5) - a(n-7) + a(n-12) + ... + A057077(m-1)*a(n-A001318(m)) + ..., where n > A001318(m). - Gevorg Hmayakyan, Jul 07 2016
a(n) ~ Pi*BesselI(1, Pi*sqrt((n+1/24)/3)) / sqrt(24*n+1). - Vaclav Kotesovec, Nov 08 2016
a(n) = A000041(n) - A047967(n). - R. J. Mathar, Nov 20 2017
Sum_{n>=1} 1/a(n) = A237515. - Amiram Eldar, Nov 15 2020
From Peter Bala, Jan 15 2021: (Start)
G.f.: (1 + x)*Sum_{n >= 0} x^(n*(n+3)/2)/Product_{k = 1..n} (1 - x^k) =
(1 + x)*(1 + x^2)*Sum_{n >= 0} x^(n*(n+5)/2)/Product_{k = 1..n} (1 - x^k) = (1 + x)*(1 + x^2)*(1 + x^3)*Sum_{n >= 0} x^(n*(n+7)/2)/Product_{k = 1..n} (1 - x^k) = ....
G.f.: (1/2)*Sum_{n >= 0} x^(n*(n-1)/2)/Product_{k = 1..n} (1 - x^k) =
(1/2)*(1/(1 + x))*Sum_{n >= 0} x^((n-1)*(n-2)/2)/Product_{k = 1..n} (1 - x^k) = (1/2)*(1/((1 + x)*(1 + x^2)))*Sum_{n >= 0} x^((n-2)*(n-3)/2)/Product_{k = 1..n} (1 - x^k) = ....
G.f.: Sum_{n >= 0} x^n/Product_{k = 1..n} (1 - x^(2*k)) = (1/(1 - x)) * Sum_{n >= 0} x^(3*n)/Product_{k = 1..n} (1 - x^(2*k)) = (1/((1 - x)*(1 - x^3))) * Sum_{n >= 0} x^(5*n)/Product_{k = 1..n} (1 - x^(2*k)) = (1/((1 - x)*(1 - x^3)*(1 - x^5))) * Sum_{n >= 0} x^(7*n)/Product_{k = 1..n} (1 - x^(2*k)) = .... (End)
From Peter Bala, Feb 02 2021: (Start)
G.f.: A(x) = Sum_{n >= 0} x^(n*(2*n-1))/Product_{k = 1..2*n} (1 - x^k). (Set z = x and q = x^2 in Mc Laughlin et al. (2019 ArXiv version), Section 1.3, Identity 7.)
Similarly, A(x) = Sum_{n >= 0} x^(n*(2*n+1))/Product_{k = 1..2*n+1} (1 - x^k). (End)
a(n) = A001227(n) + A238005(n) + A238006(n). - R. J. Mathar, Sep 08 2021
G.f.: A(x) = exp ( Sum_{n >= 1} x^n/(n*(1 - x^(2*n))) ) = exp ( Sum_{n >= 1} (-1)^(n+1)*x^n/(n*(1 - x^n)) ). - Peter Bala, Dec 23 2021
Sum_{n>=0} a(n)/exp(Pi*n) = exp(Pi/24)/2^(1/8) = A292820. - Simon Plouffe, May 12 2023 [Proof: Sum_{n>=0} a(n)/exp(Pi*n) = phi(exp(-2*Pi)) / phi(exp(-Pi)), where phi(q) is the Euler modular function. We have phi(exp(-2*Pi)) = exp(Pi/12) * Gamma(1/4) / (2 * Pi^(3/4)) and phi(exp(-Pi)) = exp(Pi/24) * Gamma(1/4) / (2^(7/8) * Pi^(3/4)), see formulas (14) and (13) in I. Mező, 2013. - Vaclav Kotesovec, May 12 2023]
a(2*n) = Sum_{j=1..n} p(n+j, 2*j) and a(2*n+1) = Sum_{j=1..n+1} p(n+j,2*j-1), where p(n, s) is the number of partitions of n having exactly s parts. - Gregory L. Simay, Aug 30 2023
EXAMPLE
G.f. = 1 + x + x^2 + 2*x^3 + 2*x^4 + 3*x^5 + 4*x^6 + 5*x^7 + 6*x^8 + 8*x^9 + ...
G.f. = q + q^25 + q^49 + 2*q^73 + 2*q^97 + 3*q^121 + 4*q^145 + 5*q^169 + ...
The partitions of n into distinct parts (see A118457) for small n are:
1: 1
2: 2
3: 3, 21
4: 4, 31
5: 5, 41, 32
6: 6, 51, 42, 321
7: 7, 61, 52, 43, 421
8: 8, 71, 62, 53, 521, 431
...
From Reinhard Zumkeller, Jun 13 2009: (Start)
a(8)=6, A140207(8)=#{5+2+1,4+3+1}=2, A003056(8)=3, A051162(8)=5;
a(9)=8, A140207(9)=#{6+2+1,5+3+1,4+3+2}=3, A003056(9)=3, A051162(9)=6;
a(10)=10, A140207(10)=#{4+3+2+1}=1, A003056(10)=4, A051162(10)=4. (End)
MAPLE
N := 100; t1 := series(mul(1+x^k, k=1..N), x, N); A000009 := proc(n) coeff(t1, x, n); end;
spec := [ P, {P=PowerSet(N), N=Sequence(Z, card>=1)} ]: [ seq(combstruct[count](spec, size=n), n=0..58) ];
spec := [ P, {P=PowerSet(N), N=Sequence(Z, card>=1)} ]: combstruct[allstructs](spec, size=10); # to get the actual partitions for n=10
A000009 := proc(n)
local x, m;
product(1+x^m, m=1..n+1) ;
expand(%) ;
coeff(%, x, n) ;
end proc: # R. J. Mathar, Jun 18 2016
# Alternatively:
simplify(expand(QDifferenceEquations:-QPochhammer(-1, x, 99)/2, x)):
seq(coeff(%, x, n), n=0..55); # Peter Luschny, Nov 17 2016
MATHEMATICA
PartitionsQ[Range[0, 60]] (* _Harvey Dale_, Jul 27 2009 *)
a[ n_] := SeriesCoefficient[ Product[ 1 + x^k, {k, n}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *)
a[ n_] := SeriesCoefficient[ 1 / Product[ 1 - x^k, {k, 1, n, 2}], {x, 0, n}]; (* Michael Somos, Jul 06 2011 *)
a[ n_] := With[ {t = Log[q] / (2 Pi I)}, SeriesCoefficient[ q^(-1/24) DedekindEta[2 t] / DedekindEta[ t], {q, 0, n}]]; (* Michael Somos, Jul 06 2011 *)
a[ n_] := SeriesCoefficient[ 1 / QPochhammer[ x, x^2], {x, 0, n}]; (* Michael Somos, May 24 2013 *)
a[ n_] := SeriesCoefficient[ Series[ QHypergeometricPFQ[ {q}, {q x}, q, - q x], {q, 0, n}] /. x -> 1, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *)
a[ n_] := SeriesCoefficient[ QHypergeometricPFQ[{}, {}, q, -1] / 2, {q, 0, n}]; (* Michael Somos, Mar 04 2014 *)
nmax = 60; CoefficientList[Series[Exp[Sum[(-1)^(k+1)/k*x^k/(1-x^k), {k, 1, nmax}]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Aug 25 2015 *)
nmax = 100; poly = ConstantArray[0, nmax + 1]; poly[[1]] = 1; poly[[2]] = 1; Do[Do[poly[[j + 1]] += poly[[j - k + 1]], {j, nmax, k, -1}]; , {k, 2, nmax}]; poly (* Vaclav Kotesovec, Jan 14 2017 *)
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( prod( k=1, n, 1 + x^k, 1 + x * O(x^n)), n))}; /* Michael Somos, Nov 17 1999 */
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A) / eta(x + A), n))};
(PARI) {a(n) = my(c); forpart(p=n, if( n<1 || p[1]<2, c++; for(i=1, #p-1, if( p[i+1] > p[i]+1, c--; break)))); c}; /* Michael Somos, Aug 13 2017 */
(PARI) lista(nn) = {q='q+O('q^nn); Vec(eta(q^2)/eta(q))} \\ Altug Alkan, Mar 20 2018
(Magma) Coefficients(&*[1+x^m:m in [1..100]])[1..100] where x is PolynomialRing(Integers()).1; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
(Haskell)
import Data.MemoCombinators (memo2, integral)
a000009 n = a000009_list !! n
a000009_list = map (pM 1) [0..] where
pM = memo2 integral integral p
p _ 0 = 1
p k m | m < k = 0
| otherwise = pM (k + 1) (m - k) + pM (k + 1) m
-- Reinhard Zumkeller, Sep 09 2015, Nov 05 2013
(Maxima) num_distinct_partitions(60, list); /* Emanuele Munarini, Feb 24 2014 */
(Maxima)
h(n):=if oddp(n)=true then 1 else 0;
S(n, m):=if n=0 then 1 else if n<m then 0 else if n=m then h(n) else sum(h(k)*S(n-k, k), k, m, n/2)+h(n);
makelist(S(n, 1), n, 0, 27); /* Vladimir Kruchinin, Sep 07 2014 */
(SageMath) # uses[EulerTransform from A166861]
a = BinaryRecurrenceSequence(0, 1)
b = EulerTransform(a)
print([b(n) for n in range(56)]) # Peter Luschny, Nov 11 2020
(Python) # uses A010815
from functools import lru_cache
from math import isqrt
@lru_cache(maxsize=None)
def A000009(n): return 1 if n == 0 else A010815(n)+2*sum((-1)**(k+1)*A000009(n-k**2) for k in range(1, isqrt(n)+1)) # Chai Wah Wu, Sep 08 2021
(Julia) # uses A010815
using Memoize
@memoize function A000009(n)
n == 0 && return 1
s = sum((-1)^k*A000009(n - k^2) for k in 1:isqrt(n))
A010815(n) - 2*s
end # Peter Luschny, Sep 09 2021
CROSSREFS
Apart from the first term, equals A052839-1. The rows of A053632 converge to this sequence. When reduced modulo 2 equals the absolute values of A010815. The positions of odd terms given by A001318.
a(n) = Sum_{n=1..m} A097306(n, m), row sums of triangle of number of partitions of n into m odd parts.
Cf. A001318, A000041, A000700, A003724, A004111, A007837, A010815, A035294, A068049, A078408, A081360, A088670, A109950, A109968, A132312, A146061, A035363, A010054, A057077, A089806, A091602, A237515, A118457 (the partitions), A118459 (partition lengths), A015723 (total number of parts), A230957 (boustrophedon transform).
Cf. A167377 (complement).
Cf. A067659 (odd number of parts), A067661 (even number of parts).
Number of r-regular partitions for r = 2 through 12: A000009, A000726, A001935, A035959, A219601, A035985, A261775, A104502, A261776, A328545, A328546.
KEYWORD
nonn,core,easy,nice,changed
STATUS
approved
Integer part of square root of n. Or, number of positive squares <= n. Or, n appears 2n+1 times.
+0
337
0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10
OFFSET
0,5
COMMENTS
Also the integer part of the geometric mean of the divisors of n. - Amarnath Murthy, Dec 19 2001
Number of numbers k (<= n) with an odd number of divisors. - Benoit Cloitre, Sep 07 2002
Also, for n > 0, the number of digits when writing n in base where place values are squares, cf. A007961; A190321(n) <= a(n). - Reinhard Zumkeller, May 08 2011
The least monotonic left inverse of squares, A000290. That is, the lexicographically least nondecreasing sequence a(n) such that a(A000290(n)) = n. - Antti Karttunen, Oct 06 2017
REFERENCES
Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 73, problem 23.
Lionel Levine, Fractal sequences and restricted Nim, Ars Combin. 80 (2006), 113-127.
Paul J. McCarthy, Introduction to Arithmetical Functions, Springer Verlag, 1986, p. 28.
N. J. A. Sloane and Allan Wilks, On sequences of Recaman type, paper in preparation, 2006.
LINKS
Franklin T. Adams-Watters, Table of n, a(n) for n = 0..10000
Krassimir Atanassov, On the 100-th, the 101-st and 102-nd Smarandache's problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 3, 94-96.
Matthew Hyatt and Marina Skyers, On the Increases of the Sequence floor(k*sqrt(n)), Electronic Journal of Combinatorial Number Theory, Volume 15 (2015), #A17.
Lionel Levine, Fractal sequences and restricted Nim, arXiv:math/0409408 [math.CO], 2004.
Paul Pollack and Joseph Vandehey, Besicovitch, Bisection, and the Normality of 0.(1)(4)(9)(16)(25)...., The American Mathematical Monthly 122.8 (2015): 757-765.
N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence)
Florentin Smarandache, Only Problems, Not Solutions!, 1993.
FORMULA
a(n) = Card(k, 0 < k <= n such that k is relatively prime to core(k)) where core(x) is the squarefree part of x. - Benoit Cloitre, May 02 2002
a(n) = a(n-1) + floor(n/(a(n-1)+1)^2), a(0) = 0. - Reinhard Zumkeller, Apr 12 2004
From Hieronymus Fischer, May 26 2007: (Start)
a(n) = Sum_{k=1..n} A010052(k).
G.f.: g(x) = (1/(1-x))*Sum_{j>=1} x^(j^2) = (theta_3(0, x) - 1)/(2*(1-x)) where theta_3 is a Jacobi theta function. (End)
a(n) = floor(A000267(n)/2). - Reinhard Zumkeller, Jun 27 2011
a(n) = floor(sqrt(n)). - Arkadiusz Wesolowski, Jan 09 2013
Sum_{n>0} 1/a(n)^s = 2*zeta(s-1) + zeta(s), where zeta is the Riemann zeta function. - Enrique Pérez Herrero, Oct 15 2013
From Wesley Ivan Hurt, Dec 31 2013: (Start)
a(n) = Sum_{i=1..n} (A000005(i) mod 2), n > 0.
a(n) = (1/2)*Sum_{i=1..n} (1 - (-1)^A000005(i)), n > 0. (End)
a(n) = sqrt(A048760(n)), n >= 0. - Wolfdieter Lang, Mar 24 2015
a(n) = Sum_{k=1..n} floor(n/k)*lambda(k) = Sum_{m=1..n} Sum_{d|m} lambda(d) where lambda(j) is Liouville lambda function, A008836. - Geoffrey Critzer, Apr 01 2015
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, May 02 2023
EXAMPLE
G.f. = x + x^2 + x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 2*x^7 + 2*x^8 + 3*x^9 + ...
MAPLE
Digits := 100; A000196 := n->floor(evalf(sqrt(n)));
MATHEMATICA
Table[n, {n, 0, 20}, {2n + 1}] //Flatten (* Zak Seidov Mar 19 2011 *)
IntegerPart[Sqrt[Range[0, 110]]] (* Harvey P. Dale, May 23 2012 *)
Floor[Sqrt[Range[0, 99]]] (* Alonso del Arte, Dec 31 2013 *)
a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, x] - 1) / (2 (1 - x)), {x, 0, n}]; (* Michael Somos, May 28 2014 *)
PROG
(Magma) [Isqrt(n) : n in [0..100]];
(PARI) {a(n) = if( n<0, 0, floor(sqrt(n)))};
(PARI) {a(n) = if( n<0, 0, sqrtint(n))};
(Haskell)
import Data.Bits (shiftL, shiftR)
a000196 :: Integer -> Integer
a000196 0 = 0
a000196 n = newton n (findx0 n 1) where
-- find x0 == 2^(a+1), such that 4^a <= n < 4^(a+1).
findx0 0 b = b
findx0 a b = findx0 (a `shiftR` 2) (b `shiftL` 1)
newton n x = if x' < x then newton n x' else x
where x' = (x + n `div` x) `div` 2
a000196_list = concat $ zipWith replicate [1, 3..] [0..]
-- Reinhard Zumkeller, Apr 12 2012, Oct 23 2010
(Python)
# from http://code.activestate.com/recipes/577821-integer-square-root-function/
def A000196(n):
if n < 0:
raise ValueError('only defined for nonnegative n')
if n == 0:
return 0
a, b = divmod(n.bit_length(), 2)
j = 2**(a+b)
while True:
k = (j + n//j)//2
if k >= j:
return j
j = k
print([A000196(n)for n in range(102)])
# Jason Kimberley, Nov 09 2016
(Python)
from math import isqrt
def a(n): return isqrt(n)
print([a(n) for n in range(102)]) # Michael S. Branicky, Feb 15 2023
(Scheme)
;; The following implementation uses higher order function LEFTINV-LEASTMONO-NC2NC from my IntSeq-library. It returns the least monotonic left inverse of any strictly growing function (see the comment-section for the definition) and although it does not converge as fast to the result as many specialized integer square root algorithms, at least it does not involve any floating point arithmetic. Thus with correctly implemented bignums it will produce correct results even with very large arguments, in contrast to just taking the floor of (sqrt n).
;; Source of LEFTINV-LEASTMONO-NC2NC can be found under https://github.com/karttu/IntSeq/blob/master/src/Transforms/transforms-core.ss and the definition of A000290 is given under that entry.
(define A000196 (LEFTINV-LEASTMONO-NC2NC 0 0 A000290)) ;; Antti Karttunen, Oct 06 2017
(Julia)
a(n) = isqrt(n) # Paul Muljadi, Jun 03 2024
CROSSREFS
KEYWORD
nonn,easy,nice
STATUS
approved
a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
(Formerly M2329 N0921)
+0
5125
1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24, 31, 18, 39, 20, 42, 32, 36, 24, 60, 31, 42, 40, 56, 30, 72, 32, 63, 48, 54, 48, 91, 38, 60, 56, 90, 42, 96, 44, 84, 78, 72, 48, 124, 57, 93, 72, 98, 54, 120, 72, 120, 80, 90, 60, 168, 62, 96, 104, 127, 84, 144, 68, 126, 96, 144
OFFSET
1,2
COMMENTS
Multiplicative: If the canonical factorization of n into prime powers is the product of p^e(p) then sigma_k(n) = Product_p ((p^((e(p)+1)*k))-1)/(p^k-1).
Sum_{d|n} 1/d^k is equal to sigma_k(n)/n^k. So sequences A017665-A017712 also give the numerators and denominators of sigma_k(n)/n^k for k = 1..24. The power sums sigma_k(n) are in sequences A000203 (this sequence) (k=1), A001157-A001160 (k=2,3,4,5), A013954-A013972 for k = 6,7,...,24. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 05 2001
A number n is abundant if sigma(n) > 2n (cf. A005101), perfect if sigma(n) = 2n (cf. A000396), deficient if sigma(n) < 2n (cf. A005100).
a(n) is the number of sublattices of index n in a generic 2-dimensional lattice. - Avi Peretz (njk(AT)netvision.net.il), Jan 29 2001 [In the language of group theory, a(n) is the number of index-n subgroups of Z x Z. - Jianing Song, Nov 05 2022]
The sublattices of index n are in one-to-one correspondence with matrices [a b; 0 d] with a>0, ad=n, b in [0..d-1]. The number of these is Sum_{d|n} d = sigma(n), which is a(n). A sublattice is primitive if gcd(a,b,d) = 1; the number of these is n * Product_{p|n} (1+1/p), which is A001615. [Cf. Grady reference.]
Sum of number of common divisors of n and m, where m runs from 1 to n. - Naohiro Nomoto, Jan 10 2004
a(n) is the cardinality of all extensions over Q_p with degree n in the algebraic closure of Q_p, where p>n. - Volker Schmitt (clamsi(AT)gmx.net), Nov 24 2004. Cf. A100976, A100977, A100978 (p-adic extensions).
Let s(n) = a(n-1) + a(n-2) - a(n-5) - a(n-7) + a(n-12) + a(n-15) - a(n-22) - a(n-26) + ..., then a(n) = s(n) if n is not pentagonal, i.e., n != (3 j^2 +- j)/2 (cf. A001318), and a(n) is instead s(n) - ((-1)^j)*n if n is pentagonal. - Gary W. Adamson, Oct 05 2008 [corrected Apr 27 2012 by William J. Keith based on Ewell and by Andrey Zabolotskiy, Apr 08 2022]
Write n as 2^k * d, where d is odd. Then a(n) is odd if and only if d is a square. - Jon Perry, Nov 08 2012
Also total number of parts in the partitions of n into equal parts. - Omar E. Pol, Jan 16 2013
Note that sigma(3^4) = 11^2. On the other hand, Kanold (1947) shows that the equation sigma(q^(p-1)) = b^p has no solutions b > 2, q prime, p odd prime. - N. J. A. Sloane, Dec 21 2013, based on postings to the Number Theory Mailing List by Vladimir Letsko and Luis H. Gallardo
Limit_{m->infinity} (Sum_{n=1..prime(m)} a(n)) / prime(m)^2 = zeta(2)/2 = Pi^2/12 (A072691). See more at A244583. - Richard R. Forberg, Jan 04 2015
a(n) + A000005(n) is an odd number iff n = 2m^2, m>=1. - Richard R. Forberg, Jan 15 2015
a(n) = a(n+1) for n = 14, 206, 957, 1334, 1364 (A002961). - Zak Seidov, May 03 2016
Also the total number of horizontal rhombuses in the terraces of the n-th level of an irregular stepped pyramid (starting from the top) whose structure arises after the k-degree-zig-zag folding of every row of the diagram of the isosceles triangle A237593, where k is an angle greater than zero and less than 180 degrees. - Omar E. Pol, Jul 05 2016
Equivalent to the Riemann hypothesis: a(n) < H(n) + exp(H(n))*log(H(n)), for all n>1, where H(n) is the n-th harmonic number (Jeffrey Lagarias). See A057641 for more details. - Ilya Gutkovskiy, Jul 05 2016
a(n) is the total number of even parts in the partitions of 2*n into equal parts. More generally, a(n) is the total number of parts congruent to 0 mod k in the partitions of k*n into equal parts (the comment dated Jan 16 2013 is the case for k = 1). - Omar E. Pol, Nov 18 2019
From Jianing Song, Nov 05 2022: (Start)
a(n) is also the number of order-n subgroups of C_n X C_n, where C_n is the cyclic group of order n. Proof: by the correspondence theorem in the group theory, there is a one-to-one correspondence between the order-n subgroups of C_n X C_n = (Z x Z)/(nZ x nZ) and the index-n subgroups of Z x Z containing nZ x nZ. But an index-n normal subgroup of a (multiplicative) group G contains {g^n : n in G} automatically. The desired result follows from the comment from Naohiro Nomoto above.
The number of subgroups of C_n X C_n that are isomorphic to C_n is A001615(n). (End)
REFERENCES
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 38.
A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 116ff.
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 162, #16, (6), 2nd formula.
G. H. Hardy, Ramanujan: twelve lectures on subjects suggested by his life and work, AMS Chelsea Publishing, Providence, Rhode Island, 2002, pp. 141, 166.
H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth Edition, Clarendon Press, Oxford, 2003.
Ross Honsberger, "Mathematical Gems, Number One," The Dolciani Mathematical Expositions, Published and Distributed by The Mathematical Association of America, page 116.
Kanold, Hans Joachim, Kreisteilungspolynome und ungerade vollkommene Zahlen. (German), Ber. Math.-Tagung Tübingen 1946, (1947). pp. 84-87.
M. Krasner, Le nombre des surcorps primitifs d'un degré donné et le nombre des surcorps métagaloisiens d'un degré donné d'un corps de nombres p-adiques. Comptes Rendus Hebdomadaires, Académie des Sciences, Paris 254, 255, 1962.
A. Lubotzky, Counting subgroups of finite index, Proceedings of the St. Andrews/Galway 93 group theory meeting, Th. 2.1. LMS Lecture Notes Series no. 212 Cambridge University Press 1995.
D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section III.1, page 77.
G. Polya, Induction and Analogy in Mathematics, vol. 1 of Mathematics and Plausible Reasoning, Princeton Univ Press 1954, page 92.
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).
Robert M. Young, Excursions in Calculus, The Mathematical Association of America, 1992 p. 361.
LINKS
Daniel Forgues, Table of n, a(n) for n = 1..100000 (first 20000 terms from N. J. A. Sloane)
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
B. Apostol and L. Petrescu, Extremal Orders of Certain Functions Associated with Regular Integers (mod n), Journal of Integer Sequences, 2013, # 13.7.5.
Joerg Arndt, On computing the generalized Lambert series, arXiv:1202.6525v3 [math.CA], (2012).
M. Baake and U. Grimm, Quasicrystalline combinatorics
C. K. Caldwell, The Prime Glossary, sigma function
Imanuel Chen and Michael Z. Spivey, Integral Generalized Binomial Coefficients of Multiplicative Functions, Preprint 2015; Summer Research Paper 238, Univ. Puget Sound.
D. Christopher and T. Nadu, Partitions with Fixed Number of Sizes, Journal of Integer Sequences, 15 (2015), #15.11.5.
J. N. Cooper and A. W. N. Riasanovsky, On the Reciprocal of the Binary Generating Function for the Sum of Divisors, 2012. - From N. J. A. Sloane, Dec 25 2012
Jason Earls, The Smarandache sum of composites between factors function, in Smarandache Notions Journal (2004), Vol. 14.1, page 243.
L. Euler, An observation on the sums of divisors, arXiv:math/0411587 [math.HO], 2004-2009.
J. A. Ewell, Recurrences for the sum of divisors, Proc. Amer. Math. Soc. 64 (2) 1977.
F. Firoozbakht and M. F. Hasler, Variations on Euclid's formula for Perfect Numbers, JIS 13 (2010) #10.3.1.
Daniele A. Gewurz and Francesca Merola, Sequences realized as Parker vectors ..., J. Integer Seqs., Vol. 6, 2003.
Johan Gielis and Ilia Tavkhelidze, The general case of cutting of GML surfaces and bodies, arXiv:1904.01414 [math.GM], 2019.
J. W. L. Glaisher, On the function chi(n), Quarterly Journal of Pure and Applied Mathematics, 20 (1884), 97-167.
J. W. L. Glaisher, On the function chi(n), Quarterly Journal of Pure and Applied Mathematics, 20 (1884), 97-167. [Annotated scanned copy]
M. J. Grady, A group theoretic approach to a famous partition formula, Amer. Math. Monthly, 112 (No. 7, 2005), 645-651.
Masazumi Honda and Takuya Yoda, String theory, N = 4 SYM and Riemann hypothesis, arXiv:2203.17091 [hep-th], 2022.
Douglas E. Iannucci, On sums of the small divisors of a natural number, arXiv:1910.11835 [math.NT], 2019.
P. A. MacMahon, Divisors of numbers and their continuations in the theory of partitions, Proc. London Math. Soc., 19 (1921), 75-113.
M. Maia and M. Mendez, On the arithmetic product of combinatorial species, arXiv:math.CO/0503436, 2005.
P. Pollack and C. Pomerance, Some problems of Erdős on the sum-of-divisors function, For Richard Guy on his 99th birthday: May his sequence be unbounded, Trans. Amer. Math. Soc. Ser. B 3 (2016), 1-26; errata.
Carl Pomerance and Hee-Sung Yang, Variant of a theorem of Erdős on the sum-of-proper-divisors function, Math. Comp. 83 (2014), 1903-1913.
J. S. Rutherford, The enumeration and symmetry-significant properties of derivative lattices, Act. Cryst. (1992) A48, 500-508. - N. J. A. Sloane, Mar 14 2009
J. S. Rutherford, The enumeration and symmetry-significant properties of derivative lattices II, Acta Cryst. A49 (1993), 293-300. - N. J. A. Sloane, Mar 14 2009
N. J. A. Sloane, "A Handbook of Integer Sequences" Fifty Years Later, arXiv:2301.03149 [math.NT], 2023, p. 3.
Eric Weisstein's World of Mathematics, Divisor Function
Wikipedia, Divisor function
FORMULA
Multiplicative with a(p^e) = (p^(e+1)-1)/(p-1). - David W. Wilson, Aug 01 2001
For the following bounds and many others, see Mitrinovic et al. - N. J. A. Sloane, Oct 02 2017
If n is composite, a(n) > n + sqrt(n).
a(n) < n*sqrt(n) for all n.
a(n) < (6/Pi^2)*n^(3/2) for n > 12.
G.f.: -x*deriv(eta(x))/eta(x) where eta(x) = Product_{n>=1} (1-x^n). - Joerg Arndt, Mar 14 2010
L.g.f.: -log(Product_{j>=1} (1-x^j)) = Sum_{n>=1} a(n)/n*x^n. - Joerg Arndt, Feb 04 2011
Dirichlet convolution of phi(n) and tau(n), i.e., a(n) = sum_{d|n} phi(n/d)*tau(d), cf. A000010, A000005.
a(n) is odd iff n is a square or twice a square. - Robert G. Wilson v, Oct 03 2001
a(n) = a(n*prime(n)) - prime(n)*a(n). - Labos Elemer, Aug 14 2003 (Clarified by Omar E. Pol, Apr 27 2016)
a(n) = n*A000041(n) - Sum_{i=1..n-1} a(i)*A000041(n-i). - Jon Perry, Sep 11 2003
a(n) = -A010815(n)*n - Sum_{k=1..n-1} A010815(k)*a(n-k). - Reinhard Zumkeller, Nov 30 2003
a(n) = f(n, 1, 1, 1), where f(n, i, x, s) = if n = 1 then s*x else if p(i)|n then f(n/p(i), i, 1+p(i)*x, s) else f(n, i+1, 1, s*x) with p(i) = i-th prime (A000040). - Reinhard Zumkeller, Nov 17 2004
Recurrence: n^2*(n-1)*a(n) = 12*Sum_{k=1..n-1} (5*k*(n-k) - n^2)*a(k)*a(n-k), if n>1. - Dominique Giard (dominique.giard(AT)gmail.com), Jan 11 2005
G.f.: Sum_{k>0} k * x^k / (1 - x^k) = Sum_{k>0} x^k / (1 - x^k)^2. Dirichlet g.f.: zeta(s)*zeta(s-1). - Michael Somos, Apr 05 2003. See the Hardy-Wright reference, p. 312. first equation, and p. 250, Theorem 290. - Wolfdieter Lang, Dec 09 2016
For odd n, a(n) = A000593(n). For even n, a(n) = A000593(n) + A074400(n/2). - Jonathan Vos Post, Mar 26 2006
Equals the inverse Moebius transform of the natural numbers. Equals row sums of A127093. - Gary W. Adamson, May 20 2007
A127093 * [1/1, 1/2, 1/3, ...] = [1/1, 3/2, 4/3, 7/4, 6/5, 12/6, 8/7, ...]. Row sums of triangle A135539. - Gary W. Adamson, Oct 31 2007
a(n) = A054785(2*n) - A000593(2*n). - Reinhard Zumkeller, Apr 23 2008
a(n) = n*Sum_{k=1..n} A060642(n,k)/k*(-1)^(k+1). - Vladimir Kruchinin, Aug 10 2010
Dirichlet convolution of A037213 and A034448. - R. J. Mathar, Apr 13 2011
G.f.: A(x) = x/(1-x)*(1 - 2*x*(1-x)/(G(0) - 2*x^2 + 2*x)); G(k) = -2*x - 1 - (1+x)*k + (2*k+3)*(x^(k+2)) - x*(k+1)*(k+3)*((-1 + (x^(k+2)))^2)/G(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 06 2011
a(n) = A001065(n) + n. - Mats Granvik, May 20 2012
a(n) = A006128(n) - A220477(n). - Omar E. Pol, Jan 17 2013
a(n) = Sum_{k=1..A003056(n)} (-1)^(k-1)*A196020(n,k). - conjectured by Omar E. Pol, Feb 02 2013, and proved by Max Alekseyev, Nov 17 2013
a(n) = Sum_{k=1..A003056(n)} (-1)^(k-1)*A000330(k)*A000716(n-A000217(k)). - Mircea Merca, Mar 05 2014
a(n) = A240698(n, A000005(n)). - Reinhard Zumkeller, Apr 10 2014
a(n) = Sum_{d^2|n} A001615(n/d^2) = Sum_{d^3|n} A254981(n/d^3). - Álvar Ibeas, Mar 06 2015
a(3*n) = A144613(n). a(3*n + 1) = A144614(n). a(3*n + 2) = A144615(n). - Michael Somos, Jul 19 2015
a(n) = Sum{i=1..n} Sum{j=1..i} cos((2*Pi*n*j)/i). - Michel Lagneau, Oct 14 2015
a(n) = A000593(n) + A146076(n). - Omar E. Pol, Apr 05 2016
a(n) = A065475(n) + A048050(n). - Omar E. Pol, Nov 28 2016
a(n) = (Pi^2*n/6)*Sum_{q>=1} c_q(n)/q^2, with the Ramanujan sums c_q(n) given in A054533 as a c_n(k) table. See the Hardy reference, p. 141, or Hardy-Wright, Theorem 293, p. 251. - Wolfdieter Lang, Jan 06 2017
G.f. also (1 - E_2(q))/24, with the g.f. E_2 of A006352. See e.g., Hardy, p. 166, eq. (10.5.5). - Wolfdieter Lang, Jan 31 2017
From Antti Karttunen, Nov 25 2017: (Start)
a(n) = A048250(n) + A162296(n).
a(n) = A092261(n) * A295294(n). [This can be further expanded, see comment in A291750.] (End)
a(n) = A000593(n) * A038712(n). - Ivan N. Ianakiev and Omar E. Pol, Nov 26 2017
a(n) = Sum_{q=1..n} c_q(n) * floor(n/q), where c_q(n) is the Ramanujan's sum function given in A054533. - Daniel Suteu, Jun 14 2018
a(n) = Sum_{k=1..n} gcd(n, k) / phi(n / gcd(n, k)), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 21 2018
a(n) = (2^(1 + (A000005(n) - A001227(n))/(A000005(n) - A183063(n))) - 1)*A000593(n) = (2^(1 + (A183063(n)/A001227(n))) - 1)*A000593(n). - Omar E. Pol, Nov 03 2018
a(n) = Sum_{i=1..n} tau(gcd(n, i)). - Ridouane Oudra, Oct 15 2019
From Peter Bala, Jan 19 2021: (Start)
G.f.: A(x) = Sum_{n >= 1} x^(n^2)*(x^n + n*(1 - x^(2*n)))/(1 - x^n)^2 - differentiate equation 5 in Arndt w.r.t. x, and set x = 1.
A(x) = F(x) + G(x), where F(x) is the g.f. of A079667 and G(x) is the g.f. of A117004. (End)
a(n) = Sum_{k=1..n} tau(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 07 2021
With the convention that a(n) = 0 for n <= 0 we have the recurrence a(n) = t(n) + Sum_{k >= 1} (-1)^(k+1)*(2*k + 1)*a(n - k*(k + 1)/2), where t(n) = (-1)^(m+1)*(2*m+1)*n/3 if n = m*(m + 1)/2, with m positive, is a triangular number else t(n) = 0. For example, n = 10 = (4*5)/2 is a triangular number, t(10) = -30, and so a(10) = -30 + 3*a(9) - 5*a(7) + 7*a(4) = -30 + 39 - 40 + 49 = 18. - Peter Bala, Apr 06 2022
Recurrence: a(p^x) = p*a(p^(x-1)) + 1, if p is prime and for any integer x. E.g., a(5^3) = 5*a(5^2) + 1 = 5*31 + 1 = 156. - Jules Beauchamp, Nov 11 2022
Sum_{n>=1} a(n)/exp(2*Pi*n) = 1/24 - 1/(8*Pi) = A319462. - Vaclav Kotesovec, May 07 2023
EXAMPLE
For example, 6 is divisible by 1, 2, 3 and 6, so sigma(6) = 1 + 2 + 3 + 6 = 12.
Let L = <V,W> be a 2-dimensional lattice. The 7 sublattices of index 4 are generated by <4V,W>, <V,4W>, <4V,W+-V>, <2V,2W>, <2V+W,2W>, <2V,2W+V>. Compare A001615.
MAPLE
with(numtheory): A000203 := n->sigma(n); seq(A000203(n), n=1..100);
MATHEMATICA
Table[ DivisorSigma[1, n], {n, 100}]
a[ n_] := SeriesCoefficient[ QPolyGamma[ 1, 1, q] / Log[q]^2, {q, 0, n}]; (* Michael Somos, Apr 25 2013 *)
PROG
(Magma) [SumOfDivisors(n): n in [1..70]];
(Magma) [DivisorSigma(1, n): n in [1..70]]; // Bruno Berselli, Sep 09 2015
(PARI) {a(n) = if( n<1, 0, sigma(n))};
(PARI) {a(n) = if( n<1, 0, direuler( p=2, n, 1 / (1 - X) /(1 - p*X))[n])};
(PARI) {a(n) = if( n<1, 0, polcoeff( sum( k=1, n, x^k / (1 - x^k)^2, x * O(x^n)), n))}; /* Michael Somos, Jan 29 2005 */
(PARI) max_n = 30; ser = - sum(k=1, max_n, log(1-x^k)); a(n) = polcoeff(ser, n)*n \\ Gottfried Helms, Aug 10 2009
(MuPAD) numlib::sigma(n)$ n=1..81 // Zerinvary Lajos, May 13 2008
(SageMath) [sigma(n, 1) for n in range(1, 71)] # Zerinvary Lajos, Jun 04 2009
(Maxima) makelist(divsum(n), n, 1, 1000); \\ Emanuele Munarini, Mar 26 2011
(Haskell)
a000203 n = product $ zipWith (\p e -> (p^(e+1)-1) `div` (p-1)) (a027748_row n) (a124010_row n)
-- Reinhard Zumkeller, May 07 2012
(Scheme) (definec (A000203 n) (if (= 1 n) n (let ((p (A020639 n)) (e (A067029 n))) (* (/ (- (expt p (+ 1 e)) 1) (- p 1)) (A000203 (A028234 n)))))) ;; Uses macro definec from http://oeis.org/wiki/Memoization#Scheme - Antti Karttunen, Nov 25 2017
(Scheme) (define (A000203 n) (let ((r (sqrt n))) (let loop ((i (inexact->exact (floor r))) (s (if (integer? r) (- r) 0))) (cond ((zero? i) s) ((zero? (modulo n i)) (loop (- i 1) (+ s i (/ n i)))) (else (loop (- i 1) s)))))) ;; (Stand-alone program) - Antti Karttunen, Feb 20 2024
(GAP)
A000203:=List([1..10^2], n->Sigma(n)); # Muniru A Asiru, Oct 01 2017
(Python)
from sympy import divisor_sigma
def a(n): return divisor_sigma(n, 1)
print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Jan 03 2021
(Python)
from math import prod
from sympy import factorint
def a(n): return prod((p**(e+1)-1)//(p-1) for p, e in factorint(n).items())
print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Feb 25 2024
(APL, Dyalog dialect) A000203 ← +/{ð←⍵{(0=⍵|⍺)/⍵}⍳⌊⍵*÷2 ⋄ 1=⍵:ð ⋄ ð, (⍵∘÷)¨(⍵=(⌊⍵*÷2)*2)↓⌽ð} ⍝ Antti Karttunen, Feb 20 2024
CROSSREFS
See A034885, A002093 for records. Bisections give A008438, A062731. Values taken are listed in A007609. A054973 is an inverse function.
For partial sums see A024916.
Row sums of A127093.
Cf. A009194, A082062 (gcd(a(n),n) and its largest prime factor), A179931, A192795 (gcd(a(n),A001157(n)) and largest prime factor).
Cf. also A034448 (sum of unitary divisors).
Cf. A007955 (products of divisors).
A001227, A000593 and this sequence have the same parity: A053866. - Omar E. Pol, May 14 2016
Cf. A054533.
KEYWORD
easy,core,nonn,nice,mult
STATUS
approved
Triangular numbers: a(n) = binomial(n+1,2) = n*(n+1)/2 = 0 + 1 + 2 + ... + n.
(Formerly M2535 N1002)
+0
4676
0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431
OFFSET
0,3
COMMENTS
Also referred to as T(n) or C(n+1, 2) or binomial(n+1, 2) (preferred).
Also generalized hexagonal numbers: n*(2*n-1), n=0, +-1, +-2, +-3, ... Generalized k-gonal numbers are second k-gonal numbers and positive terms of k-gonal numbers interleaved, k >= 5. In this case k = 6. - Omar E. Pol, Sep 13 2011 and Aug 04 2012
Number of edges in complete graph of order n+1, K_{n+1}.
Number of legal ways to insert a pair of parentheses in a string of n letters. E.g., there are 6 ways for three letters: (a)bc, (ab)c, (abc), a(b)c, a(bc), ab(c). Proof: there are C(n+2,2) ways to choose where the parentheses might go, but n + 1 of them are illegal because the parentheses are adjacent. Cf. A002415.
For n >= 1, a(n) is also the genus of a nonsingular curve of degree n+2, such as the Fermat curve x^(n+2) + y^(n+2) = 1. - Ahmed Fares (ahmedfares(AT)my_deja.com), Feb 21 2001
From Harnack's theorem (1876), the number of branches of a nonsingular curve of order n is bounded by a(n-1)+1, and the bound can be achieved. See also A152947. - Benoit Cloitre, Aug 29 2002. Corrected by Robert McLachlan, Aug 19 2024
Number of tiles in the set of double-n dominoes. - Scott A. Brown, Sep 24 2002
Number of ways a chain of n non-identical links can be broken up. This is based on a similar problem in the field of proteomics: the number of ways a peptide of n amino acid residues can be broken up in a mass spectrometer. In general, each amino acid has a different mass, so AB and BC would have different masses. - James A. Raymond, Apr 08 2003
Triangular numbers - odd numbers = shifted triangular numbers; 1, 3, 6, 10, 15, 21, ... - 1, 3, 5, 7, 9, 11, ... = 0, 0, 1, 3, 6, 10, ... - Xavier Acloque, Oct 31 2003 [Corrected by Derek Orr, May 05 2015]
Centered polygonal numbers are the result of [number of sides * A000217 + 1]. E.g., centered pentagonal numbers (1,6,16,31,...) = 5 * (0,1,3,6,...) + 1. Centered heptagonal numbers (1,8,22,43,...) = 7 * (0,1,3,6,...) + 1. - Xavier Acloque, Oct 31 2003
Maximum number of lines formed by the intersection of n+1 planes. - Ron R. King, Mar 29 2004
Number of permutations of [n] which avoid the pattern 132 and have exactly 1 descent. - Mike Zabrocki, Aug 26 2004
Number of ternary words of length n-1 with subwords (0,1), (0,2) and (1,2) not allowed. - Olivier Gérard, Aug 28 2012
Number of ways two different numbers can be selected from the set {0,1,2,...,n} without repetition, or, number of ways two different numbers can be selected from the set {1,2,...,n} with repetition.
Conjecturally, 1, 6, 120 are the only numbers that are both triangular and factorial. - Christopher M. Tomaszewski (cmt1288(AT)comcast.net), Mar 30 2005
Binomial transform is {0, 1, 5, 18, 56, 160, 432, ...}, A001793 with one leading zero. - Philippe Deléham, Aug 02 2005
Each pair of neighboring terms adds to a perfect square. - Zak Seidov, Mar 21 2006
Number of transpositions in the symmetric group of n+1 letters, i.e., the number of permutations that leave all but two elements fixed. - Geoffrey Critzer, Jun 23 2006
With rho(n):=exp(i*2*Pi/n) (an n-th root of 1) one has, for n >= 1, rho(n)^a(n) = (-1)^(n+1). Just use the triviality a(2*k+1) == 0 (mod (2*k+1)) and a(2*k) == k (mod (2*k)).
a(n) is the number of terms in the expansion of (a_1 + a_2 + a_3)^(n-1). - Sergio Falcon, Feb 12 2007
a(n+1) is the number of terms in the complete homogeneous symmetric polynomial of degree n in 2 variables. - Richard Barnes, Sep 06 2017
The number of distinct handshakes in a room with n+1 people. - Mohammad K. Azarian, Apr 12 2007 [corrected, Joerg Arndt, Jan 18 2016]
Equal to the rank (minimal cardinality of a generating set) of the semigroup PT_n\S_n, where PT_n and S_n denote the partial transformation semigroup and symmetric group on [n]. - James East, May 03 2007
a(n) gives the total number of triangles found when cevians are drawn from a single vertex on a triangle to the side opposite that vertex, where n = the number of cevians drawn+1. For instance, with 1 cevian drawn, n = 1+1 = 2 and a(n)= 2*(2+1)/2 = 3 so there is a total of 3 triangles in the figure. If 2 cevians are drawn from one point to the opposite side, then n = 1+2 = 3 and a(n) = 3*(3+1)/2 = 6 so there is a total of 6 triangles in the figure. - Noah Priluck (npriluck(AT)gmail.com), Apr 30 2007
For n >= 1, a(n) is the number of ways in which n-1 can be written as a sum of three nonnegative integers if representations differing in the order of the terms are considered to be different. In other words, for n >= 1, a(n) is the number of nonnegative integral solutions of the equation x + y + z = n-1. - Amarnath Murthy, Apr 22 2001 (edited by Robert A. Beeler)
a(n) is the number of levels with energy n + 3/2 (in units of h*f0, with Planck's constant h and the oscillator frequency f0) of the three-dimensional isotropic harmonic quantum oscillator. See the comment by A. Murthy above: n = n1 + n2 + n3 with positive integers and ordered. Proof from the o.g.f. See the A. Messiah reference. - Wolfdieter Lang, Jun 29 2007
From Hieronymus Fischer, Aug 06 2007: (Start)
Numbers m >= 0 such that round(sqrt(2m+1)) - round(sqrt(2m)) = 1.
Numbers m >= 0 such that ceiling(2*sqrt(2m+1)) - 1 = 1 + floor(2*sqrt(2m)).
Numbers m >= 0 such that fract(sqrt(2m+1)) > 1/2 and fract(sqrt(2m)) < 1/2, where fract(x) is the fractional part of x (i.e., x - floor(x), x >= 0). (End)
If Y and Z are 3-blocks of an n-set X, then, for n >= 6, a(n-1) is the number of (n-2)-subsets of X intersecting both Y and Z. - Milan Janjic, Nov 09 2007
Equals row sums of triangle A143320, n > 0. - Gary W. Adamson, Aug 07 2008
a(n) is also a perfect number A000396 if n is a Mersenne prime A000668, assuming there are no odd perfect numbers. - Omar E. Pol, Sep 05 2008
Equals row sums of triangle A152204. - Gary W. Adamson, Nov 29 2008
The number of matches played in a round robin tournament: n*(n-1)/2 gives the number of matches needed for n players. Everyone plays against everyone else exactly once. - Georg Wrede (georg(AT)iki.fi), Dec 18 2008
-a(n+1) = E(2)*binomial(n+2,2) (n >= 0) where E(n) are the Euler numbers in the enumeration A122045. Viewed this way, a(n) is the special case k=2 in the sequence of diagonals in the triangle A153641. - Peter Luschny, Jan 06 2009
Equivalent to the first differences of successive tetrahedral numbers. See A000292. - Jeremy Cahill (jcahill(AT)inbox.com), Apr 15 2009
The general formula for alternating sums of powers is in terms of the Swiss-Knife polynomials P(n,x) A153641 2^(-n-1)(P(n,1)-(-1)^k P(n,2k+1)). Thus a(k) = |2^(-3)(P(2,1)-(-1)^k P(2,2k+1))|. - Peter Luschny, Jul 12 2009
a(n) is the smallest number > a(n-1) such that gcd(n,a(n)) = gcd(n,a(n-1)). If n is odd this gcd is n; if n is even it is n/2. - Franklin T. Adams-Watters, Aug 06 2009
Partial sums of A001477. - Juri-Stepan Gerasimov, Jan 25 2010. [A-number corrected by Omar E. Pol, Jun 05 2012]
The numbers along the right edge of Floyd's triangle are 1, 3, 6, 10, 15, .... - Paul Muljadi, Jan 25 2010
From Charlie Marion, Dec 03 2010: (Start)
More generally, a(2k+1) == j*(2j-1) (mod 2k+2j+1) and
a(2k) == [-k + 2j*(j-1)] (mod 2k+2j).
Column sums of:
1 3 5 7 9 ...
1 3 5 ...
1 ...
...............
---------------
1 3 6 10 15 ...
Sum_{n>=1} 1/a(n)^2 = 4*Pi^2/3-12 = 12 less than the volume of a sphere with radius Pi^(1/3).
(End)
A004201(a(n)) = A000290(n); A004202(a(n)) = A002378(n). - Reinhard Zumkeller, Feb 12 2011
1/a(n+1), n >= 0, has e.g.f. -2*(1+x-exp(x))/x^2, and o.g.f. 2*(x+(1-x)*log(1-x))/x^2 (see the Stephen Crowley formula line). -1/(2*a(n+1)) is the z-sequence for the Sheffer triangle of the coefficients of the Bernoulli polynomials A196838/A196839. - Wolfdieter Lang, Oct 26 2011
From Charlie Marion, Feb 23 2012: (Start)
a(n) + a(A002315(k)*n + A001108(k+1)) = (A001653(k+1)*n + A001109(k+1))^2. For k=0 we obtain a(n) + a(n+1) = (n+1)^2 (identity added by N. J. A. Sloane on Feb 19 2004).
a(n) + a(A002315(k)*n - A055997(k+1)) = (A001653(k+1)*n - A001109(k))^2.
(End)
Plot the three points (0,0), (a(n), a(n+1)), (a(n+1), a(n+2)) to form a triangle. The area will be a(n+1)/2. - J. M. Bergot, May 04 2012
The sum of four consecutive triangular numbers, beginning with a(n)=n*(n+1)/2, minus 2 is 2*(n+2)^2. a(n)*a(n+2)/2 = a(a(n+1)-1). - J. M. Bergot, May 17 2012
(a(n)*a(n+3) - a(n+1)*a(n+2))*(a(n+1)*a(n+4) - a(n+2)*a(n+3))/8 = a((n^2+5*n+4)/2). - J. M. Bergot, May 18 2012
a(n)*a(n+1) + a(n+2)*a(n+3) + 3 = a(n^2 + 4*n + 6). - J. M. Bergot, May 22 2012
In general, a(n)*a(n+1) + a(n+k)*a(n+k+1) + a(k-1)*a(k) = a(n^2 + (k+2)*n + k*(k+1)). - Charlie Marion, Sep 11 2012
a(n)*a(n+3) + a(n+1)*a(n+2) = a(n^2 + 4*n + 2). - J. M. Bergot, May 22 2012
In general, a(n)*a(n+k) + a(n+1)*a(n+k-1) = a(n^2 + (k+1)*n + k-1). - Charlie Marion, Sep 11 2012
a(n)*a(n+2) + a(n+1)*a(n+3) = a(n^2 + 4*n + 3). - J. M. Bergot, May 22 2012
Three points (a(n),a(n+1)), (a(n+1),a(n)) and (a(n+2),a(n+3)) form a triangle with area 4*a(n+1). - J. M. Bergot, May 23 2012
a(n) + a(n+k) = (n+k)^2 - (k^2 + (2n-1)*k -2n)/2. For k=1 we obtain a(n) + a(n+1) = (n+1)^2 (see below). - Charlie Marion, Oct 02 2012
In n-space we can define a(n-1) nontrivial orthogonal projections. For example, in 3-space there are a(2)=3 (namely point onto line, point onto plane, line onto plane). - Douglas Latimer, Dec 17 2012
From James East, Jan 08 2013: (Start)
For n >= 1, a(n) is equal to the rank (minimal cardinality of a generating set) and idempotent rank (minimal cardinality of an idempotent generating set) of the semigroup P_n\S_n, where P_n and S_n denote the partition monoid and symmetric group on [n].
For n >= 3, a(n-1) is equal to the rank and idempotent rank of the semigroup T_n\S_n, where T_n and S_n denote the full transformation semigroup and symmetric group on [n].
(End)
For n >= 3, a(n) is equal to the rank and idempotent rank of the semigroup PT_n\S_n, where PT_n and S_n denote the partial transformation semigroup and symmetric group on [n]. - James East, Jan 15 2013
Conjecture: For n > 0, there is always a prime between A000217(n) and A000217(n+1). Sequence A065383 has the first 1000 of these primes. - Ivan N. Ianakiev, Mar 11 2013
The formula, a(n)*a(n+4k+2)/2 + a(k) = a(a(n+2k+1) - (k^2+(k+1)^2)), is a generalization of the formula a(n)*a(n+2)/2 = a(a(n+1)-1) in Bergot's comment dated May 17 2012. - Charlie Marion, Mar 28 2013
The series Sum_{k>=1} 1/a(k) = 2, given in a formula below by Jon Perry, Jul 13 2003, has partial sums 2*n/(n+1) (telescopic sum) = A022998(n)/A026741(n+1). - Wolfdieter Lang, Apr 09 2013
For odd m = 2k+1, we have the recurrence a(m*n + k) = m^2*a(n) + a(k). Corollary: If number T is in the sequence then so is 9*T+1. - Lekraj Beedassy, May 29 2013
Euler, in Section 87 of the Opera Postuma, shows that whenever T is a triangular number then 9*T + 1, 25*T + 3, 49*T + 6 and 81*T + 10 are also triangular numbers. In general, if T is a triangular number then (2*k + 1)^2*T + k*(k + 1)/2 is also a triangular number. - Peter Bala, Jan 05 2015
Using 1/b and 1/(b+2) will give a Pythagorean triangle with sides 2*b + 2, b^2 + 2*b, and b^2 + 2*b + 2. Set b=n-1 to give a triangle with sides of lengths 2*n,n^2-1, and n^2 + 1. One-fourth the perimeter = a(n) for n > 1. - J. M. Bergot, Jul 24 2013
a(n) = A028896(n)/6, where A028896(n) = s(n) - s(n-1) are the first differences of s(n) = n^3 + 3*n^2 + 2*n - 8. s(n) can be interpreted as the sum of the 12 edge lengths plus the sum of the 6 face areas plus the volume of an n X (n-1) X (n-2) rectangular prism. - J. M. Bergot, Aug 13 2013
Dimension of orthogonal group O(n+1). - Eric M. Schmidt, Sep 08 2013
Number of positive roots in the root system of type A_n (for n > 0). - Tom Edgar, Nov 05 2013
A formula for the r-th successive summation of k, for k = 1 to n, is binomial(n+r,r+1) [H. W. Gould]. - Gary Detlefs, Jan 02 2014
Also the alternating row sums of A095831. Also the alternating row sums of A055461, for n >= 1. - Omar E. Pol, Jan 26 2014
For n >= 3, a(n-2) is the number of permutations of 1,2,...,n with the distribution of up (1) - down (0) elements 0...011 (n-3 zeros), or, the same, a(n-2) is up-down coefficient {n,3} (see comment in A060351). - Vladimir Shevelev, Feb 14 2014
a(n) is the dimension of the vector space of symmetric n X n matrices. - Derek Orr, Mar 29 2014
Non-vanishing subdiagonal of A132440^2/2, aside from the initial zero. First subdiagonal of unsigned A238363. Cf. A130534 for relations to colored forests, disposition of flags on flagpoles, and colorings of the vertices of complete graphs. - Tom Copeland, Apr 05 2014
The number of Sidon subsets of {1,...,n+1} of size 2. - Carl Najafi, Apr 27 2014
Number of factors in the definition of the Vandermonde determinant V(x_1,x_2,...,x_n) = Product_{1 <= i < k <= n} x_i - x_k. - Tom Copeland, Apr 27 2014
Number of weak compositions of n into three parts. - Robert A. Beeler, May 20 2014
Suppose a bag contains a(n) red marbles and a(n+1) blue marbles, where a(n), a(n+1) are consecutive triangular numbers. Then, for n > 0, the probability of choosing two marbles at random and getting two red or two blue is 1/2. In general, for k > 2, let b(0) = 0, b(1) = 1 and, for n > 1, b(n) = (k-1)*b(n-1) - b(n-2) + 1. Suppose, for n > 0, a bag contains b(n) red marbles and b(n+1) blue marbles. Then the probability of choosing two marbles at random and getting two red or two blue is (k-1)/(k+1). See also A027941, A061278, A089817, A053142, A092521. - Charlie Marion, Nov 03 2014
Let O(n) be the oblong number n(n+1) = A002378 and S(n) the square number n^2 = A000290(n). Then a(4n) = O(3n) - O(n), a(4n+1) = S(3n+1) - S(n), a(4n+2) = S(3n+2) - S(n+1) and a(4n+3) = O(3n+2) - O(n). - Charlie Marion, Feb 21 2015
Consider the partition of the natural numbers into parts from the set S=(1,2,3,...,n). The length (order) of the signature of the resulting sequence is given by the triangular numbers. E.g., for n=10, the signature length is 55. - David Neil McGrath, May 05 2015
a(n) counts the partitions of (n-1) unlabeled objects into three (3) parts (labeled a,b,c), e.g., a(5)=15 for (n-1)=4. These are (aaaa),(bbbb),(cccc),(aaab),(aaac),(aabb),(aacc),(aabc),(abbc),(abcc),(abbb),(accc),(bbcc),(bccc),(bbbc). - David Neil McGrath, May 21 2015
Conjecture: the sequence is the genus/deficiency of the sinusoidal spirals of index n which are algebraic curves. The value 0 corresponds to the case of the Bernoulli Lemniscate n=2. So the formula conjectured is (n-1)(n-2)/2. - Wolfgang Tintemann, Aug 02 2015
Conjecture: Let m be any positive integer. Then, for each n = 1,2,3,... the set {Sum_{k=s..t} 1/k^m: 1 <= s <= t <= n} has cardinality a(n) = n*(n+1)/2; in other words, all the sums Sum_{k=s..t} 1/k^m with 1 <= s <= t are pairwise distinct. (I have checked this conjecture via a computer and found no counterexample.) - Zhi-Wei Sun, Sep 09 2015
The Pisano period lengths of reading the sequence modulo m seem to be A022998(m). - R. J. Mathar, Nov 29 2015
For n >= 1, a(n) is the number of compositions of n+4 into n parts avoiding the part 2. - Milan Janjic, Jan 07 2016
In this sequence only 3 is prime. - Fabian Kopp, Jan 09 2016
Suppose you are playing Bulgarian Solitaire (see A242424 and Chamberland's and Gardner's books) and, for n > 0, you are starting with a single pile of a(n) cards. Then the number of operations needed to reach the fixed state {n, n-1,...,1} is a(n-1). For example, {6}->{5,1}->{4,2}->{3,2,1}. - Charlie Marion, Jan 14 2016
Numbers k such that 8k + 1 is a square. - Juri-Stepan Gerasimov, Apr 09 2016
Every perfect cube is the difference of the squares of two consecutive triangular numbers. 1^2-0^2 = 1^3, 3^2-1^2 = 2^3, 6^2-3^2 = 3^3. - Miquel Cerda, Jun 26 2016
For n > 1, a(n) = tau_n(k*) where tau_n(k) is the number of ordered n-factorizations of k and k* is the square of a prime. For example, tau_3(4) = tau_3(9) = tau_3(25) = tau_3(49) = 6 (see A007425) since the number of divisors of 4, 9, 25, and 49's divisors is 6, and a(3) = 6. - Melvin Peralta, Aug 29 2016
In an (n+1)-dimensional hypercube, number of two-dimensional faces congruent with a vertex (see also A001788). - Stanislav Sykora, Oct 23 2016
Generalizations of the familiar formulas, a(n) + a(n+1) = (n+1)^2 (Feb 19 2004) and a(n)^2 + a(n+1)^2 = a((n+1)^2) (Nov 22 2006), follow: a(n) + a(n+2k-1) + 4a(k-1) = (n+k)^2 + 6a(k-1) and a(n)^2 + a(n+2k-1)^2 + (4a(k-1))^2 + 3a(k-1) = a((n+k)^2 + 6a(k-1)). - Charlie Marion, Nov 27 2016
a(n) is also the greatest possible number of diagonals in a polyhedron with n+4 vertices. - Vladimir Letsko, Dec 19 2016
For n > 0, 2^5 * (binomial(n+1,2))^2 represents the first integer in a sum of 2*(2*n + 1)^2 consecutive integers that equals (2*n + 1)^6. - Patrick J. McNab, Dec 25 2016
Does not satisfy Benford's law (cf. Ross, 2012). - N. J. A. Sloane, Feb 12 2017
Number of ordered triples (a,b,c) of positive integers not larger than n such that a+b+c = 2n+1. - Aviel Livay, Feb 13 2017
Number of inequivalent tetrahedral face colorings using at most n colors so that no color appears only once. - David Nacin, Feb 22 2017
Also the Wiener index of the complete graph K_{n+1}. - Eric W. Weisstein, Sep 07 2017
Number of intersections between the Bernstein polynomials of degree n. - Eric Desbiaux, Apr 01 2018
a(n) is the area of a triangle with vertices at (1,1), (n+1,n+2), and ((n+1)^2, (n+2)^2). - Art Baker, Dec 06 2018
For n > 0, a(n) is the smallest k > 0 such that n divides numerator of (1/a(1) + 1/a(2) + ... + 1/a(n-1) + 1/k). It should be noted that 1/1 + 1/3 + 1/6 + ... + 2/(n(n+1)) = 2n/(n+1). - Thomas Ordowski, Aug 04 2019
Upper bound of the number of lines in an n-homogeneous supersolvable line arrangement (see Theorem 1.1 in Dimca). - Stefano Spezia, Oct 04 2019
For n > 0, a(n+1) is the number of lattice points on a triangular grid with side length n. - Wesley Ivan Hurt, Aug 12 2020
From Michael Chu, May 04 2022: (Start)
Maximum number of distinct nonempty substrings of a string of length n.
Maximum cardinality of the sumset A+A, where A is a set of n numbers. (End)
a(n) is the number of parking functions of size n avoiding the patterns 123, 132, and 312. - Lara Pudwell, Apr 10 2023
Suppose two rows, each consisting of n evenly spaced dots, are drawn in parallel. Suppose we bijectively draw lines between the dots of the two rows. For n >= 1, a(n - 1) is the maximal possible number of intersections between the lines. Equivalently, the maximal number of inversions in a permutation of [n]. - Sela Fried, Apr 18 2023
The following equation complements the generalization in Bala's Comment (Jan 05 2015). (2k + 1)^2*a(n) + a(k) = a((2k + 1)*n + k). - Charlie Marion, Aug 28 2023
a(n) + a(n+k) + a(k-1) + (k-1)*n = (n+k)^2. For k = 1, we have a(n) + a(n+1) = (n+1)^2. - Charlie Marion, Nov 17 2023
REFERENCES
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 828.
C. Alsina and R. B. Nelson, Charming Proofs: A Journey into Elegant Mathematics, MAA, 2010. See Chapter 1.
T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 189.
A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 109ff.
Marc Chamberland, Single Digits: In Praise of Small Numbers, Chapter 3, The Number Three, p. 72, Princeton University Press, 2015.
L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 155.
J. M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 309 pp 46-196, Ellipses, Paris, 2004
E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 6.
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 1.
Martin Gardner, Colossal Book of Mathematics, Chapter 34, Bulgarian Solitaire and Other Seemingly Endless Tasks, pp. 455-467, W. W. Norton & Company, 2001.
James Gleick, The Information: A History, A Theory, A Flood, Pantheon, 2011. [On page 82 mentions a table of the first 19999 triangular numbers published by E. de Joncort in 1762.]
Cay S. Horstmann, Scala for the Impatient. Upper Saddle River, New Jersey: Addison-Wesley (2012): 171.
Labos E.: On the number of RGB-colors we can distinguish. Partition Spectra. Lecture at 7th Hungarian Conference on Biometry and Biomathematics. Budapest. Jul 06 2005.
A. Messiah, Quantum Mechanics, Vol.1, North Holland, Amsterdam, 1965, p. 457.
J. C. P. Miller, editor, Table of Binomial Coefficients. Royal Society Mathematical Tables, Vol. 3, Cambridge Univ. Press, 1954.
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. Trotter, Some Identities for the Triangular Numbers, Journal of Recreational Mathematics, Spring 1973, 6(2).
D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, pp. 91-93 Penguin Books 1987.
LINKS
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math.Series 55, Tenth Printing, 1972.
K. Adegoke, R. Frontzcak and T. Goy, Special formulas involving polygonal numbers and Horadam numbers, Carpathian Math. Publ., 13 (2021), no. 1, 207-216.
Ayomikun Adeniran and Lara Pudwell, Pattern avoidance in parking functions, Enumer. Comb. Appl. 3:3 (2023), Article S2R17.
Joerg Arndt, Matters Computational (The Fxtbook), section 39.7, pp. 776-778.
S. Barbero, U. Cerruti, and N. Murru, A Generalization of the Binomial Interpolated Operator and its Action on Linear Recurrent Sequences , J. Int. Seq. 13 (2010) # 10.9.7, proposition 18.
Jean-Luc Baril, Sergey Kirgizov, and Vincent Vajnovszki, Descent distribution on Catalan words avoiding a pattern of length at most three, arXiv:1803.06706 [math.CO], 2018.
Paul Barry, A Catalan Transform and Related Transformations on Integer Sequences, Journal of Integer Sequences, Vol. 8 (2005), Article 05.4.5.
T. Beldon and T. Gardiner, Triangular numbers and perfect squares, The Mathematical Gazette 86 (2002), 423-431.
Michael Boardman, The Egg-Drop Numbers, Mathematics Magazine, 77 (2004), 368-372. [From Parthasarathy Nambi, Sep 30 2009]
Anicius Manlius Severinus Boethius, De institutione arithmetica, libri duo, Sections 7-9.
Sadek Bouroubi and Ali Debbache, An unexpected meeting between the P^3_1-set and the cubic-triangular numbers, arXiv:2001.11407 [math.NT], 2020.
P. J. Cameron, Sequences realized by oligomorphic permutation groups, J. Integ. Seqs. Vol. 3 (2000), #00.1.5.
Bikash Chakraborty, Proof Without Words: Sums of Powers of Natural numbers, arXiv:2012.11539 [math.HO], 2020.
Robert Dawson, On Some Sequences Related to Sums of Powers, J. Int. Seq., Vol. 21 (2018), Article 18.7.6.
Karl Dienger, Beiträge zur Lehre von den arithmetischen und geometrischen Reihen höherer Ordnung, Jahres-Bericht Ludwig-Wilhelm-Gymnasium Rastatt, Rastatt, 1910. [Annotated scanned copy]
Alexandru Dimca and Takuro Abe, On complex supersolvable line arrangements, arXiv:1907.12497 [math.AG], 2019.
Tomislav Došlić, Maximum Product Over Partitions Into Distinct Parts, Journal of Integer Sequences, Vol. 8 (2005), Article 05.5.8.
Askar Dzhumadil'daev and Damir Yeliussizov, Power Sums of Binomial Coefficients, Journal of Integer Sequences, Vol. 16 (2013), #13.1.1.
J. East, Presentations for singular subsemigroups of the partial transformation semigroup, Internat. J. Algebra Comput., 20 (2010), no. 1, 1-25.
J. East, On the singular part of the partition monoid, Internat. J. Algebra Comput., 21 (2011), no. 1-2, 147-178.
Gennady Eremin, Naturalized bracket row and Motzkin triangle, arXiv:2004.09866 [math.CO], 2020.
Leonhard Euler, The Euler archive - E806 D, Miscellanea, Section 87, Opera Postuma Mathematica et Physica, 2 vols., St. Petersburg Academy of Science, 1862.
E. T. Frankel, A calculus of figurate numbers and finite differences, American Mathematical Monthly, 57 (1950), 14-25. [Annotated scanned copy]
Fekadu Tolessa Gedefa, On The Log-Concavity of Polygonal Figurate Number Sequences, arXiv:2006.05286 [math.CO], 2020.
Adam Grabowski, Polygonal Numbers, Formalized Mathematics, Vol. 21, No. 2, Pages 103-113, 2013; DOI: 10.2478/forma-2013-0012; alternate copy
C. Hamberg, Triangular Numbers Are Everywhere, llinois Mathematics and Science Academy, IMSA Math Journal: a Resource Notebook for High School Mathematics (1992), pp. 7-10.
Guo-Niu Han, Enumeration of Standard Puzzles [Cached copy]
A. M. Hinz, S. Klavžar, U. Milutinović, and C. Petr, The Tower of Hanoi - Myths and Maths, Birkhäuser 2013. See page 35. Book's website
J. M. Howie, Idempotent generators in finite full transformation semigroups, Proc. Roy. Soc. Edinburgh Sect. A, 81 (1978), no. 3-4, 317-323.
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 253 [Dead link]
Xiangdong Ji, Chapter 8: Structure of Finite Nuclei, Lecture notes for Phys 741 at Univ. of Maryland, pp. 139-140 [From Tom Copeland, Apr 07 2014].
R. Jovanovic, Triangular numbers [Cached copy at Wayback Machine]
Sameen Ahmed Khan, Sums of the powers of reciprocals of polygonal numbers, Int'l J. of Appl. Math. (2020) Vol. 33, No. 2, 265-282.
Hyun Kwang Kim, On regular polytope numbers, Proc. Amer. Math. Soc., 131 (2003), 65-75.
Clark Kimberling, Complementary Equations, Journal of Integer Sequences, Vol. 10 (2007), Article 07.1.4.
Clark Kimberling and John E. Brown, Partial Complements and Transposable Dispersions, J. Integer Seqs., Vol. 7, 2004.
A. J. F. Leatherland, Triangle Numbers on Ulam Spiral. In Eric Weisstein's World of Mathematics, there is a reference in the entry for Prime Spiral to Leatherland, A. J. F., The Mysterious Prime Spiral Phenomenon. - N. J. A. Sloane, Dec 13 2019
Sergey V. Muravyov, Liudmila I. Khudonogova, and Ekaterina Y. Emelyanova, Interval data fusion with preference aggregation, Measurement (2017), see page 5.
Enrique Navarrete and Daniel Orellana, Finding Prime Numbers as Fixed Points of Sequences, arXiv:1907.10023 [math.NT], 2019.
A. Nowicki, The numbers a^2+b^2-dc^2, J. Int. Seq. 18 (2015) # 15.2.3.
Ed Pegg, Jr., Sequence Pictures, Math Games column, Dec 08 2003.
Ed Pegg, Jr., Sequence Pictures, Math Games column, Dec 08 2003 [Cached copy, with permission (pdf only)]
Michael Penn, A functional equation from the Netherlands, YouTube video, 2021.
Alexsandar Petojevic, The Function vM_m(s; a; z) and Some Well-Known Sequences, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7.
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
David G. Radcliffe, A product rule for triangular numbers, arXiv:1606.05398 [math.NT], 2016.
F. Richman, Triangle numbers
J. Riordan, Review of Frankel (1950) [Annotated scanned copy]
Luis Manuel Rivera, Integer sequences and k-commuting permutations, arXiv preprint arXiv:1406.3081 [math.CO], 2014-2015.
Kenneth A. Ross, First Digits of Squares and Cubes, Math. Mag. 85 (2012) 36-42. doi:10.4169/math.mag.85.1.36 .
Frank Ruskey and Jennifer Woodcock, The Rand and block distances of pairs of set partitions, in Combinatorial Algorithms, 287-299, Lecture Notes in Comput. Sci., 7056, Springer, Heidelberg, 2011.
Sci.math Newsgroup, Square numbers which are triangular [Broken link: Cached copy]
James A. Sellers, Partitions Excluding Specific Polygonal Numbers As Parts, Journal of Integer Sequences, Vol. 7 (2004), Article 04.2.4.
Claude-Alexandre Simonetti, A new mathematical symbol : the termirial, arXiv:2005.00348 [math.GM], 2020.
Amelia Carolina Sparavigna, The groupoid of the Triangular Numbers and the generation of related integer sequences, Politecnico di Torino, Italy (2019).
H. Stamm-Wilbrandt, Sum of Pascal's triangle reciprocals [Cached copy from the Wayback Machine]
T. Trotter, Some Identities for the Triangular Numbers, J. Rec. Math. vol. 6, no. 2 Spring 1973. [Cached copy from the Wayback Machine]
G. Villemin's Almanach of Numbers, Nombres Triangulaires
Manuel Vogel, Motion of a Single Particle in a Real Penning Trap, Particle Confinement in Penning Traps, Springer Series on Atomic, Optical, and Plasma Physics, Vol. 100. Springer, Cham. 2018, 61-88.
Michel Waldschmidt, Continued fractions, École de recherche CIMPA-Oujda, Théorie des Nombres et ses Applications, 18 - 29 mai 2015: Oujda (Maroc).
FORMULA
G.f.: x/(1-x)^3. - Simon Plouffe in his 1992 dissertation
E.g.f.: exp(x)*(x+x^2/2).
a(n) = a(-1-n).
a(n) + a(n-1)*a(n+1) = a(n)^2. - Terrel Trotter, Jr., Apr 08 2002
a(n) = (-1)^n*Sum_{k=1..n} (-1)^k*k^2. - Benoit Cloitre, Aug 29 2002
a(n+1) = ((n+2)/n)*a(n), Sum_{n>=1} 1/a(n) = 2. - Jon Perry, Jul 13 2003
For n > 0, a(n) = A001109(n) - Sum_{k=0..n-1} (2*k+1)*A001652(n-1-k); e.g., 10 = 204 - (1*119 + 3*20 + 5*3 + 7*0). - Charlie Marion, Jul 18 2003
With interpolated zeros, this is n*(n+2)*(1+(-1)^n)/16. - Benoit Cloitre, Aug 19 2003
a(n+1) is the determinant of the n X n symmetric Pascal matrix M_(i, j) = binomial(i+j+1, i). - Benoit Cloitre, Aug 19 2003
a(n) = ((n+1)^3 - n^3 - 1)/6. - Xavier Acloque, Oct 24 2003
a(n) = a(n-1) + (1 + sqrt(1 + 8*a(n-1)))/2. This recursive relation is inverted when taking the negative branch of the square root, i.e., a(n) is transformed into a(n-1) rather than a(n+1). - Carl R. White, Nov 04 2003
a(n) = Sum_{k=1..n} phi(k)*floor(n/k) = Sum_{k=1..n} A000010(k)*A010766(n, k) (R. Dedekind). - Vladeta Jovovic, Feb 05 2004
a(n) + a(n+1) = (n+1)^2. - N. J. A. Sloane, Feb 19 2004
a(n) = a(n-2) + 2*n - 1. - Paul Barry, Jul 17 2004
a(n) = sqrt(Sum_{i=1..n} Sum_{j=1..n} (i*j)) = sqrt(A000537(n)). - Alexander Adamchuk, Oct 24 2004
a(n) = sqrt(sqrt(Sum_{i=1..n} Sum_{j=1..n} (i*j)^3)) = (Sum_{i=1..n} Sum_{j=1..n} Sum_{k=1..n} (i*j*k)^3)^(1/6). - Alexander Adamchuk, Oct 26 2004
a(n) == 1 (mod n+2) if n is odd and a(n) == n/2+2 (mod n+2) if n is even. - Jon Perry, Dec 16 2004
a(0) = 0, a(1) = 1, a(n) = 2*a(n-1) - a(n-2) + 1. - Miklos Kristof, Mar 09 2005
a(n) = a(n-1) + n. - Zak Seidov, Mar 06 2005
a(n) = A108299(n+3,4) = -A108299(n+4,5). - Reinhard Zumkeller, Jun 01 2005
a(n) = A111808(n,2) for n > 1. - Reinhard Zumkeller, Aug 17 2005
a(n)*a(n+1) = A006011(n+1) = (n+1)^2*(n^2+2)/4 = 3*A002415(n+1) = 1/2*a(n^2+2*n). a(n-1)*a(n) = (1/2)*a(n^2-1). - Alexander Adamchuk, Apr 13 2006 [Corrected and edited by Charlie Marion, Nov 26 2010]
a(n) = floor((2*n+1)^2/8). - Paul Barry, May 29 2006
For positive n, we have a(8*a(n))/a(n) = 4*(2*n+1)^2 = (4*n+2)^2, i.e., a(A033996(n))/a(n) = 4*A016754(n) = (A016825(n))^2 = A016826(n). - Lekraj Beedassy, Jul 29 2006
a(n)^2 + a(n+1)^2 = a((n+1)^2) [R B Nelsen, Math Mag 70 (2) (1997), p. 130]. - R. J. Mathar, Nov 22 2006
a(n) = A126890(n,0). - Reinhard Zumkeller, Dec 30 2006
a(n)*a(n+k)+a(n+1)*a(n+1+k) = a((n+1)*(n+1+k)). Generalizes previous formula dated Nov 22 2006 [and comments by J. M. Bergot dated May 22 2012]. - Charlie Marion, Feb 04 2011
(sqrt(8*a(n)+1)-1)/2 = n. - David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 26 2007
a(n) = A023896(n) + A067392(n). - Lekraj Beedassy, Mar 02 2007
Sum_{k=0..n} a(k)*A039599(n,k) = A002457(n-1), for n >= 1. - Philippe Deléham, Jun 10 2007
8*a(n)^3 + a(n)^2 = Y(n)^2, where Y(n) = n*(n+1)*(2*n+1)/2 = 3*A000330(n). - Mohamed Bouhamida, Nov 06 2007 [Edited by Derek Orr, May 05 2015]
A general formula for polygonal numbers is P(k,n) = (k-2)*(n-1)n/2 + n = n + (k-2)*A000217(n-1), for n >= 1, k >= 3. - Omar E. Pol, Apr 28 2008 and Mar 31 2013
a(3*n) = A081266(n), a(4*n) = A033585(n), a(5*n) = A144312(n), a(6*n) = A144314(n). - Reinhard Zumkeller, Sep 17 2008
a(n) = A022264(n) - A049450(n). - Reinhard Zumkeller, Oct 09 2008
If we define f(n,i,a) = Sum_{j=0..k-1} (binomial(n,k)*Stirling1(n-k,i)*Product_{j=0..k-1} (-a-j)), then a(n) = -f(n,n-1,1), for n >= 1. - Milan Janjic, Dec 20 2008
4*a(x) + 4*a(y) + 1 = (x+y+1)^2 + (x-y)^2. - Vladimir Shevelev, Jan 21 2009
a(n) = A000124(n-1) + n-1 for n >= 2. a(n) = A000124(n) - 1. - Jaroslav Krizek, Jun 16 2009
An exponential generating function for the inverse of this sequence is given by Sum_{m>=0} ((Pochhammer(1, m)*Pochhammer(1, m))*x^m/(Pochhammer(3, m)*factorial(m))) = ((2-2*x)*log(1-x)+2*x)/x^2, the n-th derivative of which has a closed form which must be evaluated by taking the limit as x->0. A000217(n+1) = (lim_{x->0} d^n/dx^n (((2-2*x)*log(1-x)+2*x)/x^2))^-1 = (lim_{x->0} (2*Gamma(n)*(-1/x)^n*(n*(x/(-1+x))^n*(-x+1+n)*LerchPhi(x/(-1+x), 1, n) + (-1+x)*(n+1)*(x/(-1+x))^n + n*(log(1-x)+log(-1/(-1+x)))*(-x+1+n))/x^2))^-1. - Stephen Crowley, Jun 28 2009
a(n) = A034856(n+1) - A005408(n) = A005843(n) + A000124(n) - A005408(n). - Jaroslav Krizek, Sep 05 2009
a(A006894(n)) = a(A072638(n-1)+1) = A072638(n) = A006894(n+1)-1 for n >= 1. For n=4, a(11) = 66. - Jaroslav Krizek, Sep 12 2009
With offset 1, a(n) = floor(n^3/(n+1))/2. - Gary Detlefs, Feb 14 2010
a(n) = 4*a(floor(n/2)) + (-1)^(n+1)*floor((n+1)/2). - Bruno Berselli, May 23 2010
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3); a(0)=0, a(1)=1. - Mark Dols, Aug 20 2010
From Charlie Marion, Oct 15 2010: (Start)
a(n) + 2*a(n-1) + a(n-2) = n^2 + (n-1)^2; and
a(n) + 3*a(n-1) + 3*a(n-2) + a(n-3) = n^2 + 2*(n-1)^2 + (n-2)^2.
In general, for n >= m > 2, Sum_{k=0..m} binomial(m,m-k)*a(n-k) = Sum_{k=0..m-1} binomial(m-1,m-1-k)*(n-k)^2.
a(n) - 2*a(n-1) + a(n-2) = 1, a(n) - 3*a(n-1) + 3*a(n-2) - a(n-3) = 0 and a(n) - 4*a(n-1) + 6*a(n-2) - 4*(a-3) + a(n-4) = 0.
In general, for n >= m > 2, Sum_{k=0..m} (-1)^k*binomial(m,m-k)*a(n-k) = 0.
(End)
a(n) = sqrt(A000537(n)). - Zak Seidov, Dec 07 2010
For n > 0, a(n) = 1/(Integral_{x=0..Pi/2} 4*(sin(x))^(2*n-1)*(cos(x))^3). - Francesco Daddi, Aug 02 2011
a(n) = A110654(n)*A008619(n). - Reinhard Zumkeller, Aug 24 2011
a(2*k-1) = A000384(k), a(2*k) = A014105(k), k > 0. - Omar E. Pol, Sep 13 2011
a(n) = A026741(n)*A026741(n+1). - Charles R Greathouse IV, Apr 01 2012
a(n) + a(a(n)) + 1 = a(a(n)+1). - J. M. Bergot, Apr 27 2012
a(n) = -s(n+1,n), where s(n,k) are the Stirling numbers of the first kind, A048994. - Mircea Merca, May 03 2012
a(n)*a(n+1) = a(Sum_{m=1..n} A005408(m))/2, for n >= 1. For example, if n=8, then a(8)*a(9) = a(80)/2 = 1620. - Ivan N. Ianakiev, May 27 2012
a(n) = A002378(n)/2 = (A001318(n) + A085787(n))/2. - Omar E. Pol, Jan 11 2013
G.f.: x * (1 + 3x + 6x^2 + ...) = x * Product_{j>=0} (1+x^(2^j))^3 = x * A(x) * A(x^2) * A(x^4) * ..., where A(x) = (1 + 3x + 3x^2 + x^3). - Gary W. Adamson, Jun 26 2012
G.f.: G(0) where G(k) = 1 + (2*k+3)*x/(2*k+1 - x*(k+2)*(2*k+1)/(x*(k+2) + (k+1)/G(k+1))); (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Nov 23 2012
a(n) = A002088(n) + A063985(n). - Reinhard Zumkeller, Jan 21 2013
G.f.: x + 3*x^2/(Q(0)-3*x) where Q(k) = 1 + k*(x+1) + 3*x - x*(k+1)*(k+4)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Mar 14 2013
a(n) + a(n+1) + a(n+2) + a(n+3) + n = a(2*n+4). - Ivan N. Ianakiev, Mar 16 2013
a(n) + a(n+1) + ... + a(n+8) + 6*n = a(3*n+15). - Charlie Marion, Mar 18 2013
a(n) + a(n+1) + ... + a(n+20) + 2*n^2 + 57*n = a(5*n+55). - Charlie Marion, Mar 18 2013
3*a(n) + a(n-1) = a(2*n), for n > 0. - Ivan N. Ianakiev, Apr 05 2013
In general, a(k*n) = (2*k-1)*a(n) + a((k-1)*n-1). - Charlie Marion, Apr 20 2015
Also, a(k*n) = a(k)*a(n) + a(k-1)*a(n-1). - Robert Israel, Apr 20 2015
a(n+1) = det(binomial(i+2,j+1), 1 <= i,j <= n). - Mircea Merca, Apr 06 2013
a(n) = floor(n/2) + ceiling(n^2/2) = n - floor(n/2) + floor(n^2/2). - Wesley Ivan Hurt, Jun 15 2013
a(n) = floor((n+1)/(exp(2/(n+1))-1)). - Richard R. Forberg, Jun 22 2013
Sum_{n>=1} a(n)/n! = 3*exp(1)/2 by the e.g.f. Also see A067764 regarding ratios calculated this way for binomial coefficients in general. - Richard R. Forberg, Jul 15 2013
Sum_{n>=1} (-1)^(n+1)/a(n) = 4*log(2) - 2 = 0.7725887... . - Richard R. Forberg, Aug 11 2014
2/(Sum_{n>=m} 1/a(n)) = m, for m > 0. - Richard R. Forberg, Aug 12 2014
A228474(a(n))=n; A248952(a(n))=0; A248953(a(n))=a(n); A248961(a(n))=A000330(n). - Reinhard Zumkeller, Oct 20 2014
a(a(n)-1) + a(a(n+2)-1) + 1 = A000124(n+1)^2. - Charlie Marion, Nov 04 2014
a(n) = 2*A000292(n) - A000330(n). - Luciano Ancora, Mar 14 2015
a(n) = A007494(n-1) + A099392(n) for n > 0. - Bui Quang Tuan, Mar 27 2015
Sum_{k=0..n} k*a(k+1) = a(A000096(n+1)). - Charlie Marion, Jul 15 2015
Let O(n) be the oblong number n(n+1) = A002378(n) and S(n) the square number n^2 = A000290(n). Then a(n) + a(n+2k) = O(n+k) + S(k) and a(n) + a(n+2k+1) = S(n+k+1) + O(k). - Charlie Marion, Jul 16 2015
A generalization of the Nov 22 2006 formula, a(n)^2 + a(n+1)^2 = a((n+1)^2), follows. Let T(k,n) = a(n) + k. Then for all k, T(k,n)^2 + T(k,n+1)^2 = T(k,(n+1)^2 + 2*k) - 2*k. - Charlie Marion, Dec 10 2015
a(n)^2 + a(n+1)^2 = a(a(n) + a(n+1)). Deducible from N. J. A. Sloane's a(n) + a(n+1) = (n+1)^2 and R. B. Nelson's a(n)^2 + a(n+1)^2 = a((n+1)^2). - Ben Paul Thurston, Dec 28 2015
Dirichlet g.f.: (zeta(s-2) + zeta(s-1))/2. - Ilya Gutkovskiy, Jun 26 2016
a(n)^2 - a(n-1)^2 = n^3. - Miquel Cerda, Jun 29 2016
a(n) = A080851(0,n-1). - R. J. Mathar, Jul 28 2016
a(n) = A000290(n-1) - A034856(n-4). - Peter M. Chema, Sep 25 2016
a(n)^2 + a(n+3)^2 + 19 = a(n^2 + 4*n + 10). - Charlie Marion, Nov 23 2016
2*a(n)^2 + a(n) = a(n^2+n). - Charlie Marion, Nov 29 2016
G.f.: x/(1-x)^3 = (x * r(x) * r(x^3) * r(x^9) * r(x^27) * ...), where r(x) = (1 + x + x^2)^3 = (1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6). - Gary W. Adamson, Dec 03 2016
a(n) = sum of the elements of inverse of matrix Q(n), where Q(n) has elements q_i,j = 1/(1-4*(i-j)^2). So if e = appropriately sized vector consisting of 1's, then a(n) = e'.Q(n)^-1.e. - Michael Yukish, Mar 20 2017
a(n) = Sum_{k=1..n} ((2*k-1)!!*(2*n-2*k-1)!!)/((2*k-2)!!*(2*n-2*k)!!). - Michael Yukish, Mar 20 2017
Sum_{i=0..k-1} a(n+i) = (3*k*n^2 + 3*n*k^2 + k^3 - k)/6. - Christopher Hohl, Feb 23 2019
a(n) = A060544(n + 1) - A016754(n). - Ralf Steiner, Nov 09 2019
a(n) == 0 (mod n) iff n is odd (see De Koninck reference). - Bernard Schott, Jan 10 2020
8*a(k)*a(n) + ((a(k)-1)*n + a(k))^2 = ((a(k)+1)*n + a(k))^2. This formula reduces to the well-known formula, 8*a(n) + 1 = (2*n+1)^2, when k = 1. - Charlie Marion, Jul 23 2020
a(k)*a(n) = Sum_{i = 0..k-1} (-1)^i*a((k-i)*(n-i)). - Charlie Marion, Dec 04 2020
From Amiram Eldar, Jan 20 2021: (Start)
Product_{n>=1} (1 + 1/a(n)) = cosh(sqrt(7)*Pi/2)/(2*Pi).
Product_{n>=2} (1 - 1/a(n)) = 1/3. (End)
a(n) = Sum_{k=1..2*n-1} (-1)^(k+1)*a(k)*a(2*n-k). For example, for n = 4, 1*28 - 3*21 + 6*15 - 10*10 + 15*6 - 21*3 + 28*1 = 10. - Charlie Marion, Mar 23 2022
2*a(n) = A000384(n) - n^2 + 2*n. In general, if P(k,n) = the n-th k-gonal number, then (j+1)*a(n) = P(5 + j, n) - n^2 + (j+1)*n. More generally, (j+1)*P(k,n) = P(2*k + (k-2)*(j-1),n) - n^2 + (j+1)*n. - Charlie Marion, Mar 14 2023
a(n) = A109613(n) * A004526(n+1). - Torlach Rush, Nov 10 2023
a(n) = (1/6)* Sum_{k = 0..3*n} (-1)^(n+k+1) * k*(k + 1) * binomial(3*n+k, 2*k). - Peter Bala, Nov 03 2024
EXAMPLE
G.f.: x + 3*x^2 + 6*x^3 + 10*x^4 + 15*x^5 + 21*x^6 + 28*x^7 + 36*x^8 + 45*x^9 + ...
When n=3, a(3) = 4*3/2 = 6.
Example(a(4)=10): ABCD where A, B, C and D are different links in a chain or different amino acids in a peptide possible fragments: A, B, C, D, AB, ABC, ABCD, BC, BCD, CD = 10.
a(2): hollyhock leaves on the Tokugawa Mon, a(4): points in Pythagorean tetractys, a(5): object balls in eight-ball billiards. - Bradley Klee, Aug 24 2015
From Gus Wiseman, Oct 28 2020: (Start)
The a(1) = 1 through a(5) = 15 ordered triples of positive integers summing to n + 2 [Beeler, McGrath above] are the following. These compositions are ranked by A014311.
(111) (112) (113) (114) (115)
(121) (122) (123) (124)
(211) (131) (132) (133)
(212) (141) (142)
(221) (213) (151)
(311) (222) (214)
(231) (223)
(312) (232)
(321) (241)
(411) (313)
(322)
(331)
(412)
(421)
(511)
The unordered version is A001399(n-3) = A069905(n), with Heinz numbers A014612.
The strict case is A001399(n-6)*6, ranked by A337453.
The unordered strict case is A001399(n-6), with Heinz numbers A007304.
(End)
MAPLE
A000217 := proc(n) n*(n+1)/2; end;
istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return true else return false; end if; end proc; # N. J. A. Sloane, May 25 2008
ZL := [S, {S=Prod(B, B, B), B=Set(Z, 1 <= card)}, unlabeled]:
seq(combstruct[count](ZL, size=n), n=2..55); # Zerinvary Lajos, Mar 24 2007
isA000217 := proc(n)
issqr(1+8*n) ;
end proc: # R. J. Mathar, Nov 29 2015 [This is the recipe Leonhard Euler proposes in chapter VII of his "Vollständige Anleitung zur Algebra", 1765. Peter Luschny, Sep 02 2022]
MATHEMATICA
Array[ #*(# - 1)/2 &, 54] (* Zerinvary Lajos, Jul 10 2009 *)
FoldList[#1 + #2 &, 0, Range@ 50] (* Robert G. Wilson v, Feb 02 2011 *)
Accumulate[Range[0, 70]] (* Harvey P. Dale, Sep 09 2012 *)
CoefficientList[Series[x / (1 - x)^3, {x, 0, 50}], x] (* Vincenzo Librandi, Jul 30 2014 *)
(* For Mathematica 10.4+ *) Table[PolygonalNumber[n], {n, 0, 53}] (* Arkadiusz Wesolowski, Aug 27 2016 *)
LinearRecurrence[{3, -3, 1}, {0, 1, 3}, 54] (* Robert G. Wilson v, Dec 04 2016 *)
(* The following Mathematica program, courtesy of Steven J. Miller, is useful for testing if a sequence is Benford. To test a different sequence only one line needs to be changed. This strongly suggests that the triangular numbers are not Benford, since the second and third columns of the output disagree. - N. J. A. Sloane, Feb 12 2017 *)
fd[x_] := Floor[10^Mod[Log[10, x], 1]]
benfordtest[num_] := Module[{},
For[d = 1, d <= 9, d++, digit[d] = 0];
For[n = 1, n <= num, n++,
{
d = fd[n(n+1)/2];
If[d != 0, digit[d] = digit[d] + 1];
}];
For[d = 1, d <= 9, d++, digit[d] = 1.0 digit[d]/num];
For[d = 1, d <= 9, d++,
Print[d, " ", 100.0 digit[d], " ", 100.0 Log[10, (d + 1)/d]]];
];
benfordtest[20000]
Table[Length[Join@@Permutations/@IntegerPartitions[n, {3}]], {n, 0, 15}] (* Gus Wiseman, Oct 28 2020 *)
PROG
(PARI) A000217(n) = n * (n + 1) / 2;
(PARI) is_A000217(n)=n*2==(1+n=sqrtint(2*n))*n \\ M. F. Hasler, May 24 2012
(PARI) is(n)=ispolygonal(n, 3) \\ Charles R Greathouse IV, Feb 28 2014
(PARI) list(lim)=my(v=List(), n, t); while((t=n*n++/2)<=lim, listput(v, t)); Vec(v) \\ Charles R Greathouse IV, Jun 18 2021
(Haskell)
a000217 n = a000217_list !! n
a000217_list = scanl1 (+) [0..] -- Reinhard Zumkeller, Sep 23 2011
(Magma) [n*(n+1)/2: n in [0..60]]; // Bruno Berselli, Jul 11 2014
(Magma) [n: n in [0..1500] | IsSquare(8*n+1)]; // Juri-Stepan Gerasimov, Apr 09 2016
(SageMath) [n*(n+1)/2 for n in (0..60)] # Bruno Berselli, Jul 11 2014
(Scala) (1 to 53).scanLeft(0)(_ + _) // Horstmann (2012), p. 171
(Scheme) (define (A000217 n) (/ (* n (+ n 1)) 2)) ;; Antti Karttunen, Jul 08 2017
(J) a000217=: *-:@>: NB. Stephen Makdisi, May 02 2018
(Python) for n in range(0, 60): print(n*(n+1)/2, end=', ') # Stefano Spezia, Dec 06 2018
(Python) # Intended to compute the initial segment of the sequence, not
# isolated terms. If in the iteration the line "x, y = x + y + 1, y + 1"
# is replaced by "x, y = x + y + k, y + k" then the figurate numbers are obtained,
# for k = 0 (natural A001477), k = 1 (triangular), k = 2 (squares), k = 3 (pentagonal), k = 4 (hexagonal), k = 5 (heptagonal), k = 6 (octagonal), etc.
def aList():
x, y = 1, 1
yield 0
while True:
yield x
x, y = x + y + 1, y + 1
A000217 = aList()
print([next(A000217) for i in range(54)]) # Peter Luschny, Aug 03 2019
CROSSREFS
The figurate numbers, with parameter k as in the second Python program: A001477 (k=0), this sequence (k=1), A000290 (k=2), A000326 (k=3), A000384 (k=4), A000566 (k=5), A000567 (k=6), A001106 (k=7), A001107 (k=8).
a(n) = A110449(n, 0).
a(n) = A110555(n+2, 2).
A diagonal of A008291.
Column 2 of A195152.
Numbers of the form n*t(n+k,h)-(n+k)*t(n,h), where t(i,h) = i*(i+2*h+1)/2 for any h (for A000217 is k=1): A005563, A067728, A140091, A140681, A212331.
Boustrophedon transforms: A000718, A000746.
Iterations: A007501 (start=2), A013589 (start=4), A050542 (start=5), A050548 (start=7), A050536 (start=8), A050909 (start=9).
Cf. A002817 (doubly triangular numbers), A075528 (solutions of a(n)=a(m)/2).
Cf. A104712 (first column, starting with a(1)).
Some generalized k-gonal numbers are A001318 (k=5), this sequence (k=6), A085787 (k=7), etc.
A001399(n-3) = A069905(n) = A211540(n+2) counts 3-part partitions.
A001399(n-6) = A069905(n-3) = A211540(n-1) counts 3-part strict partitions.
A011782 counts compositions of any length.
A337461 counts pairwise coprime triples, with unordered version A307719.
KEYWORD
nonn,core,easy,nice
EXTENSIONS
Edited by Derek Orr, May 05 2015
STATUS
approved
Numbers written in base of triangular numbers.
+0
7
1, 2, 10, 11, 12, 100, 101, 102, 110, 1000, 1001, 1002, 1010, 1011, 10000, 10001, 10002, 10010, 10011, 10012, 100000, 100001, 100002, 100010, 100011, 100012, 100100, 1000000, 1000001, 1000002, 1000010, 1000011, 1000012, 1000100, 1000101, 10000000, 10000001
OFFSET
1,2
COMMENTS
A003056 and A057945 give lengths and sums. - Reinhard Zumkeller, Mar 27 2011
REFERENCES
F. Smarandache, "Properties of the numbers", Univ. of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ.
LINKS
F. Iacobescu, Smarandache Partition Type and Other Sequences, Bull. Pure Appl. Sciences, Vol. 16E, No. 2 (1997), pp. 237-240.
Eric Weisstein's World of Mathematics, Smarandache Sequences.
EXAMPLE
The digits (from right to left) have values 1, 3, 6, 10, etc. (A000217), hence a(20) = 10012 because 20 = 1*15 + 0*10 + 0*6 + 1*3 + 2*1. - Stefano Spezia, Apr 25 2024
MATHEMATICA
A000217[n_]:=n(n+1)/2; a[n_]:=Module[{k=0}, num=n; digits={}; k=Floor[(Sqrt[1+8num]-1)/2]; While[num>0, AppendTo[digits, Floor[num/A000217[k]]]; num=Mod[num, A000217[k]]; kold=k; k=Floor[(Sqrt[1+8num]-1)/2]; While[k<kold-1, AppendTo[digits, 0]; kold--]]; FromDigits[digits]]; Array[a, 37] (* Stefano Spezia, Apr 25 2024 *)
PROG
(Haskell)
a000462 n = g [] n $ reverse $ takeWhile (<= n) $ tail a000217_list where
g as 0 [] = read $ concat $ map show $ reverse as :: Integer
g as x (t:ts) = g (a:as) r ts where (a, r) = divMod x t
-- Reinhard Zumkeller, Mar 27 2011
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
John Radu (Suttones(AT)aol.com)
STATUS
approved
Mersenne primes (primes of the form 2^n - 1).
(Formerly M2696 N1080)
+0
622
3, 7, 31, 127, 8191, 131071, 524287, 2147483647, 2305843009213693951, 618970019642690137449562111, 162259276829213363391578010288127, 170141183460469231731687303715884105727
OFFSET
1,1
COMMENTS
For a Mersenne number 2^n - 1 to be prime, the exponent n must itself be prime.
See A000043 for the values of n.
Primes that are repunits in base 2.
Define f(k) = 2k+1; begin with k = 2, a(n+1) = least prime of the form f(f(f(...(a(n)))). - Amarnath Murthy, Dec 26 2003
Mersenne primes other than the first are of the form 6n+1. - Lekraj Beedassy, Aug 27 2004. Mersenne primes other than the first are of the form 24n+7; see also A124477. - Artur Jasinski, Nov 25 2007
A034876(a(n)) = 0 and A034876(a(n)+1) = 1. - Jonathan Sondow, Dec 19 2004
Mersenne primes are solutions to sigma(n+1)-sigma(n) = n as perfect numbers (A000396(n)) are solutions to sigma(n) = 2n. In fact, appears to give all n such that sigma(n+1)-sigma(n) = n. - Benoit Cloitre, Aug 27 2002
If n is in the sequence then sigma(sigma(n)) = 2n+1. Is it true that this sequence gives all numbers n such that sigma(sigma(n)) = 2n+1? - Farideh Firoozbakht, Aug 19 2005
It is easily proved that if n is a Mersenne prime then sigma(sigma(n)) - sigma(n) = n. Is it true that Mersenne primes are all the solutions of the equation sigma(sigma(x)) - sigma(x) = x? - Farideh Firoozbakht, Feb 12 2008
Sum of divisors of n-th even superperfect number A061652(n). Sum of divisors of n-th superperfect number A019279(n), if there are no odd superperfect numbers. - Omar E. Pol, Mar 11 2008
Indices of both triangular numbers and generalized hexagonal numbers (A000217) that are also even perfect numbers. - Omar E. Pol, May 10 2008, Sep 22 2013
Number of positive integers (1, 2, 3, ...) whose sum is the n-th perfect number A000396(n). - Omar E. Pol, May 10 2008
Vertex number where the n-th perfect number A000396(n) is located in the square spiral whose vertices are the positive triangular numbers A000217. - Omar E. Pol, May 10 2008
Mersenne numbers A000225 whose indices are the prime numbers A000043. - Omar E. Pol, Aug 31 2008
The digital roots are 1 if p == 1 (mod 6) and 4 if p == 5 (mod 6). [T. Koshy, Math Gaz. 89 (2005) p. 465]
Primes p such that for all primes q < p, p XOR q = p - q. - Brad Clardy, Oct 26 2011
All these primes, except 3, are Brazilian primes, so they are also in A085104 and A023195. - Bernard Schott, Dec 26 2012
All prime numbers p can be classified by k = (p mod 12) into four classes: k=1, 5, 7, 11. The Mersennne prime numbers 2^p-1, p > 2 are in the class k=7 with p=12*(n-1)+7, n=1,2,.... As all 2^p (p odd) are in class k=8 it follows that all 2^p-1, p > 2 are in class k=7. - Freimut Marschner, Jul 27 2013
From "The Guinness Book of Primes": "During the reign of Queen Elizabeth I, the largest known prime number was the number of grains of rice on the chessboard up to and including the nineteenth square: 524,287 [= 2^19 - 1]. By the time Lord Nelson was fighting the Battle of Trafalgar, the record for the largest prime had gone up to the thirty-first square of the chessboard: 2,147,483,647 [= 2^31 - 1]. This ten-digits number was proved to be prime in 1772 by the Swiss mathematician Leonard Euler, and it held the record until 1867." [du Sautoy] - Robert G. Wilson v, Nov 26 2013
If n is in the sequence then A024816(n) = antisigma(n) = antisigma(n+1) - 1. Is it true that this sequence gives all numbers n such that antisigma(n) = antisigma(n+1) - 1? Are there composite numbers with this property? - Jaroslav Krizek, Jan 24 2014
If n is in the sequence then phi(n) + sigma(sigma(n)) = 3n. Is it true that Mersenne primes are all the solutions of the equation phi(x) + sigma(sigma(x)) = 3x? - Farideh Firoozbakht, Sep 03 2014
a(5) = A229381(2) = 8191 is the "Simpsons' Mersenne prime". - Jonathan Sondow, Jan 02 2015
Equivalently, prime powers of the form 2^n - 1, see Theorem 2 in Lemos & Cambraia Junior. - Charles R Greathouse IV, Jul 07 2016
Primes whose sum of divisors is a power of 2. Primes p such that p + 1 is a power of 2. Primes in A046528. - Omar E. Pol, Jul 09 2016
From Jaroslav Krizek, Jan 19 2017: (Start)
Primes p such that sigma(p+1) = 2p+1.
Primes p such that A051027(p) = sigma(sigma(p)) = 2^k-1 for some k > 1.
Primes p of the form sigma(2^prime(n)-1)-1 for some n. Corresponding values of numbers n are in A016027.
Primes p of the form sigma(2^(n-1)) for some n > 1. Corresponding values of numbers n are in A000043 (Mersenne exponents).
Primes of the form sigma(2^(n+1)) for some n > 1. Corresponding values of numbers n are in A153798 (Mersenne exponents-2).
Primes p of the form sigma(n) where n is even; subsequence of A023195. Primes p of the form sigma(n) for some n. Conjecture: 31 is the only prime p such that p = sigma(x) = sigma(y) for distinct numbers x and y; 31 = sigma(16) = sigma(25).
Conjecture: numbers n such that n = sigma(sigma(n+1)-n-1))-1, i.e., A072868(n)-1.
Conjecture: primes of the form sigma(4*(n-1)) for some n. Corresponding values of numbers n are in A281312. (End)
[Conjecture] For n > 2, the Mersenne number M(n) = 2^n - 1 is a prime if and only if 3^M(n-1) == -1 (mod M(n)). - Thomas Ordowski, Aug 12 2018 [This needs proof! - Joerg Arndt, Mar 31 2019]
Named "Mersenne's numbers" by W. W. Rouse Ball (1892, 1912) after Marin Mersenne (1588-1648). - Amiram Eldar, Feb 20 2021
Theorem. Let b = 2^p - 1 (where p is a prime). Then b is a Mersenne prime iff (c = 2^p - 2 is totient or a term of A002202). Otherwise, if c is (nontotient or a term of A005277) then b is composite. Proof. Trivial, since, while b = v^g - 1 where v is even, v > 2, g is integer, g > 1, b is always composite, and c = v^g - 2 is nontotient (or a term of A005277), and so is for any composite b = 2^g - 1 (in the last case, c = v^g - 2 is also nontotient, or a term of A005277). - Sergey Pavlov, Aug 30 2021 [Disclaimer: This proof has not been checked. - N. J. A. Sloane, Oct 01 2021]
REFERENCES
Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 4.
John Brillhart, D. H. Lehmer, J. L. Selfridge, Bryant Tuckerman and S. S. Wagstaff, Jr., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
Graham Everest, Alf van der Poorten, Igor Shparlinski and Thomas Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.
Marcus P. F. du Sautoy, The Number Mysteries, A Mathematical Odyssey Through Everyday Life, Palgrave Macmillan, First published in 2010 by the Fourth Estate, an imprint of Harper Collins UK, 2011, p. 46. - Robert G. Wilson v, Nov 26 2013
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).
Bryant Tuckerman, The 24th Mersenne prime, Notices Amer. Math. Soc., 18 (Jun, 1971), Abstract 684-A15, p. 608.
LINKS
Peter Alfeld, The 39th Mersenne prime, 2003.
Yan Bingze, Li Qiong, Mao Haokun, and Chen Nan, An efficient hybrid hash based privacy amplification algorithm for quantum key distribution, arXiv:2105.13678 [quant-ph], 2021.
Andrew R. Booker, The Nth Prime Page
W. W. Rouse Ball, Mathematical recreations and problems of past and present times, London, Macmillan and Co., 1892, pp. 24-25.
W. W. Rouse Ball, Mersenne's numbers, Messenger of Mathematics, Vol. 21 (1892), pp. 34-40, 121.
W. W. Rouse Ball, Mersenne's numbers, Nature, Vol. 89 (1912), p. 86.
John Brillhart, D. H. Lehmer, J. L. Selfridge, Bryant Tuckerman and S. S. Wagstaff, Jr., Factorizations of b^n +- 1, Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 3rd edition, 2002.
Kevin A. Broughan and Qizhi Zhou, On the Ratio of the Sum of Divisors and Euler's Totient Function II, Journal of Integer Sequences, Vol. 17 (2014), Article 14.9.2.
Douglas Butler, Mersenne Primes.
C. K. Caldwell, Mersenne primes.
C. K. Caldwell, "Top Twenty" page, Mersenne Primes.
Luis H. Gallardo and Olivier Rahavandrainy, On (unitary) perfect polynomials over F_2 with only Mersenne primes as odd divisors, arXiv:1908.00106 [math.NT], 2019.
Richard K. Guy, The strong law of small numbers. Amer. Math. Monthly 95 (1988), no. 8, 697-712. [Annotated scanned copy]
Sameen Ahmed Khan, Primes in Geometric-Arithmetic Progression, arXiv preprint arXiv:1203.2083 [math.NT], 2012. - From N. J. A. Sloane, Sep 15 2012
Abílio Lemos and Ady Cambraia Junior, On the number of prime factors of Mersenne numbers, arXiv:1606.08690 [math.NT] (2016).
Benny Lim, Prime Numbers Generated From Highly Composite Numbers, Parabola (2018) Vol. 54, Issue 3.
Math Reference Project, Mersenne and Fermat Primes.
Romeo Meštrović, Euclid's theorem on the infinitude of primes: a historical survey of its proofs (300 BC--2012) and another new proof, arXiv preprint arXiv:1202.3670 [math.HO], 2012. - From N. J. A. Sloane, Jun 13 2012
Romeo Meštrović, Goldbach-type conjectures arising from some arithmetic progressions, University of Montenegro, 2018.
Passawan Noppakaew and Prapanpong Pongsriiam, Product of Some Polynomials and Arithmetic Functions, J. Int. Seq. (2023) Vol. 26, Art. 23.9.1.
Christian Salas, Cantor Primes as Prime-Valued Cyclotomic Polynomials, arXiv preprint arXiv:1203.3969 [math.NT], 2012.
Harry J. Smith, Mersenne Primes, 1981-2010.
Gordon Spence, 36th Mersenne Prime Found, 1999.
Susan Stepney, Mersenne Prime.
Thesaurus.maths.org, Mersenne Prime.
Bryant Tuckerman, The 24th Mersenne prime, Proc. Nat. Acad. Sci. USA, Vol. 68 (1971), pp. 2319-2320.
Samuel S. Wagstaff, Jr., The Cunningham Project.
Yunlan Wei, Yanpeng Zheng, Zhaolin Jiang and Sugoog Shon, A Study of Determinants and Inverses for Periodic Tridiagonal Toeplitz Matrices with Perturbed Corners Involving Mersenne Numbers, Mathematics, Vol. 7, No. 10 (2019), 893.
Eric Weisstein's World of Mathematics, Mersenne Prime.
Eric Weisstein's World of Mathematics, Perfect Number.
Wikipedia, Mersenne prime.
Marek Wolf, Computer experiments with Mersenne primes, arXiv preprint arXiv:1112.2412 [math.NT], 2011.
FORMULA
a(n) = sigma(A061652(n)) = A000203(A061652(n)). - Omar E. Pol, Apr 15 2008
a(n) = sigma(A019279(n)) = A000203(A019279(n)), provided that there are no odd superperfect numbers. - Omar E. Pol, May 10 2008
a(n) = A000225(A000043(n)). - Omar E. Pol, Aug 31 2008
a(n) = 2^A000043(n) - 1 = 2^(A000005(A061652(n))) - 1. - Omar E. Pol, Oct 27 2011
a(n) = A000040(A059305(n)) = A001348(A016027(n)). - Omar E. Pol, Jun 29 2012
a(n) = A007947(A000396(n))/2, provided that there are no odd perfect numbers. - Omar E. Pol, Feb 01 2013
a(n) = 4*A134709(n) + 3. - Ivan N. Ianakiev, Sep 07 2013
a(n) = A003056(A000396(n)), provided that there are no odd perfect numbers. - Omar E. Pol, Dec 19 2016
Sum_{n>=1} 1/a(n) = A173898. - Amiram Eldar, Feb 20 2021
MAPLE
A000668 := proc(n) local i;
i := 2^(ithprime(n))-1:
if (isprime(i)) then
return i
fi: end:
seq(A000668(n), n=1..31); # Jani Melik, Feb 09 2011
# Alternate:
seq(numtheory:-mersenne([i]), i=1..26); # Robert Israel, Jul 13 2014
MATHEMATICA
2^Array[MersennePrimeExponent, 18] - 1 (* Jean-François Alcover, Feb 17 2018, Mersenne primes with less than 1000 digits *)
2^MersennePrimeExponent[Range[18]] - 1 (* Eric W. Weisstein, Sep 04 2021 *)
PROG
(PARI) forprime(p=2, 1e5, if(ispseudoprime(2^p-1), print1(2^p-1", "))) \\ Charles R Greathouse IV, Jul 15 2011
(PARI) LL(e) = my(n, h); n = 2^e-1; h = Mod(2, n); for (k=1, e-2, h=2*h*h-1); return(0==h) \\ after Joerg Arndt in A000043
forprime(p=1, , if(LL(p), print1(p, ", "))) \\ Felix Fröhlich, Feb 17 2018
(GAP)
A000668:=Filtered(List(Filtered([1..600], IsPrime), i->2^i-1), IsPrime); # Muniru A Asiru, Oct 01 2017
(Python)
from sympy import isprime, primerange
print([2**n-1 for n in primerange(1, 1001) if isprime(2**n-1)]) # Karl V. Keller, Jr., Jul 16 2020
CROSSREFS
Cf. A000225 (Mersenne numbers).
Cf. A000043 (Mersenne exponents).
Cf. A001348 (Mersenne numbers with n prime).
KEYWORD
nonn,nice,hard
STATUS
approved
Number of odd divisors of n.
+0
436
1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 4, 1, 2, 3, 2, 2, 4, 2, 2, 2, 3, 2, 4, 2, 2, 4, 2, 1, 4, 2, 4, 3, 2, 2, 4, 2, 2, 4, 2, 2, 6, 2, 2, 2, 3, 3, 4, 2, 2, 4, 4, 2, 4, 2, 2, 4, 2, 2, 6, 1, 4, 4, 2, 2, 4, 4, 2, 3, 2, 2, 6, 2, 4, 4, 2, 2, 5, 2, 2, 4, 4, 2, 4, 2, 2, 6, 4, 2, 4, 2, 4, 2, 2, 3, 6, 3, 2, 4, 2, 2, 8
OFFSET
1,3
COMMENTS
Also (1) number of ways to write n as difference of two triangular numbers (A000217), see A136107; (2) number of ways to arrange n identical objects in a trapezoid. - Tom Verhoeff
Also number of partitions of n into consecutive positive integers including the trivial partition of length 1 (e.g., 9 = 2+3+4 or 4+5 or 9 so a(9)=3). (Useful for cribbage players.) See A069283. - Henry Bottomley, Apr 13 2000
This has been described as Sylvester's theorem, but to reduce ambiguity I suggest calling it Sylvester's enumeration. - Gus Wiseman, Oct 04 2022
a(n) is also the number of factors in the factorization of the Chebyshev polynomial of the first kind T_n(x). - Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 28 2003
Number of factors in the factorization of the polynomial x^n+1 over the integers. See also A000005. - T. D. Noe, Apr 16 2003
a(n) = 1 iff n is a power of 2 (see A000079). - Lekraj Beedassy, Apr 12 2005
Number of occurrences of n in A049777. - Philippe Deléham, Jun 19 2005
For n odd, n is prime iff the n-th term of the sequence is 2. - George J. Schaeffer (gschaeff(AT)andrew.cmu.edu), Sep 10 2005
Also number of partitions of n such that if k is the largest part, then each of the parts 1,2,...,k-1 occurs exactly once. Example: a(9)=3 because we have [3,3,2,1],[2,2,2,2,1] and [1,1,1,1,1,1,1,1,1]. - Emeric Deutsch, Mar 07 2006
Also the number of factors of the n-th Lucas polynomial. - T. D. Noe, Mar 09 2006
Lengths of rows of triangle A182469;
Denoted by Delta_0(n) in Glaisher 1907. - Michael Somos, May 17 2013
Also the number of partitions p of n into distinct parts such that max(p) - min(p) < length(p). - Clark Kimberling, Apr 18 2014
Row sums of triangle A247795. - Reinhard Zumkeller, Sep 28 2014
Row sums of triangle A237048. - Omar E. Pol, Oct 24 2014
A069288(n) <= a(n). - Reinhard Zumkeller, Apr 05 2015
A000203, A000593 and this sequence have the same parity: A053866. - Omar E. Pol, May 14 2016
a(n) is equal to the number of ways to write 2*n-1 as (4*x + 2)*y + 4*x + 1 where x and y are nonnegative integers. Also a(n) is equal to the number of distinct values of k such that k/(2*n-1) + k divides (k/(2*n-1))^(k/(2*n-1)) + k, (k/(2*n-1))^k + k/(2*n-1) and k^(k/(2*n-1)) + k/(2*n-1). - Juri-Stepan Gerasimov, May 23 2016, Jul 15 2016
Also the number of odd divisors of n*2^m for m >= 0. - Juri-Stepan Gerasimov, Jul 15 2016
a(n) is odd iff n is a square or twice a square. - Juri-Stepan Gerasimov, Jul 17 2016
a(n) is also the number of subparts in the symmetric representation of sigma(n). For more information see A279387 and A237593. - Omar E. Pol, Nov 05 2016
a(n) is also the number of partitions of n into an odd number of equal parts. - Omar E. Pol, May 14 2017 [This follows from the g.f. Sum_{k >= 1} x^k/(1-x^(2*k)). - N. J. A. Sloane, Dec 03 2020]
The smallest integer with exactly m odd divisors is A038547(m). - Bernard Schott, Nov 21 2021
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 487 Entry 47.
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 306.
J. W. L. Glaisher, On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares, Quart. J. Math. 38 (1907), 1-62 (see p. 4).
Ronald. L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics, 2nd ed. (Addison-Wesley, 1994), see exercise 2.30 on p. 65.
P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 2, p 28.
LINKS
K. S. Brown's Mathpages, Partitions into Consecutive Integers.
Atli Fannar Franklín, Pattern avoidance enumerated by inversions, arXiv:2410.07467 [math.CO], 2024. See pp. 2, 18.
J. W. L. Glaisher, On the representations of a number as the sum of two, four, six, eight, ten, and twelve squares, Quart. J. Math. 38 (1907), 1-62 (see p. 4 and p. 8).
Gerzson Kéri, The factorization of compressed Chebyshev polynomials and other polynomials related to multiple-angle formulas, Annales Univ. Sci. Budapest (Hungary, 2022) Sect. Comp., Vol. 53, 93-108.
Mircea Merca, Combinatorial interpretations of a recent convolution for the number of divisors of a positive integer, Journal of Number Theory, Volume 160, March 2016, Pages 60-75, function tau_o(n).
M. A. Nyblom, On the representation of the integers as a difference of nonconsecutive triangular numbers, Fibonacci Quarterly 39:3 (2001), pp. 256-263.
N. J. A. Sloane, Transforms.
T. Verhoeff, Rectangular and Trapezoidal Arrangements, J. Integer Sequences, Vol. 2 (1999), Article 99.1.6.
Eric Weisstein's World of Mathematics, Binomial Number and Odd Divisor Function.
Eric Weisstein's World of Mathematics, q-Polygamma Function.
FORMULA
Dirichlet g.f.: zeta(s)^2*(1-1/2^s).
Comment from N. J. A. Sloane, Dec 02 2020: (Start)
By counting the odd divisors f n in different ways, we get three different ways of writing the ordinary generating function. It is:
A(x) = x + x^2 + 2*x^3 + x^4 + 2*x^5 + 2*x^6 + 2*x^7 + x^8 + 3*x^9 + 2*x^10 + ...
= Sum_{k >= 1} x^(2*k-1)/(1-x^(2*k-1))
= Sum_{k >= 1} x^k/(1-x^(2*k))
= Sum_{k >= 1} x^(k*(k+1)/2)/(1-x^k) [Ramanujan, 2nd notebook, p. 355.].
(This incorporates comments from Vladeta Jovovic, Oct 16 2002 and Michael Somos, Oct 30 2005.) (End)
G.f.: x/(1-x) + Sum_{n>=1} x^(3*n)/(1-x^(2*n)), also L(x)-L(x^2) where L(x) = Sum_{n>=1} x^n/(1-x^n). - Joerg Arndt, Nov 06 2010
a(n) = A000005(n)/(A007814(n)+1) = A000005(n)/A001511(n).
Multiplicative with a(p^e) = 1 if p = 2; e+1 if p > 2. - David W. Wilson, Aug 01 2001
a(n) = A000005(A000265(n)). - Lekraj Beedassy, Jan 07 2005
Moebius transform is period 2 sequence [1, 0, ...] = A000035, which means a(n) is the Dirichlet convolution of A000035 and A057427.
a(n) = A113414(2*n). - N. J. A. Sloane, Jan 24 2006 (corrected Nov 10 2007)
a(n) = A001826(n) + A001842(n). - Reinhard Zumkeller, Apr 18 2006
Sequence = M*V = A115369 * A000005, where M = an infinite lower triangular matrix and V = A000005, d(n); as a vector: [1, 2, 2, 3, 2, 4, ...]. - Gary W. Adamson, Apr 15 2007
Equals A051731 * [1,0,1,0,1,...]; where A051731 is the inverse Mobius transform. - Gary W. Adamson, Nov 06 2007
a(n) = A000005(n) - A183063(n).
a(n) = d(n) if n is odd, or d(n) - d(n/2) if n is even, where d(n) is the number of divisors of n (A000005). (See the Weisstein page.) - Gary W. Adamson, Mar 15 2011
Dirichlet convolution of A000005 and A154955 (interpreted as a flat sequence). - R. J. Mathar, Jun 28 2011
a(A000079(n)) = 1; a(A057716(n)) > 1; a(A093641(n)) <= 2; a(A038550(n)) = 2; a(A105441(n)) > 2; a(A072502(n)) = 3. - Reinhard Zumkeller, May 01 2012
a(n) = 1 + A069283(n). - R. J. Mathar, Jun 18 2015
a(A002110(n)/2) = n, n >= 1. - Altug Alkan, Sep 29 2015
a(n*2^m) = a(n*2^i), a((2*j+1)^n) = n+1 for m >= 0, i >= 0 and j >= 0. a((2*x+1)^n) = a((2*y+1)^n) for positive x and y. - Juri-Stepan Gerasimov, Jul 17 2016
Conjectures: a(n) = A067742(n) + 2*A131576(n) = A082647(n) + A131576(n). - Omar E. Pol, Feb 15 2017
a(n) = A000005(2n) - A000005(n) = A099777(n)-A000005(n). - Danny Rorabaugh, Oct 03 2017
L.g.f.: -log(Product_{k>=1} (1 - x^(2*k-1))^(1/(2*k-1))) = Sum_{n>=1} a(n)*x^n/n. - Ilya Gutkovskiy, Jul 30 2018
G.f.: (psi_{q^2}(1/2) + log(1-q^2))/log(q), where psi_q(z) is the q-digamma function. - Michael Somos, Jun 01 2019
a(n) = A003056(n) - A238005(n). - Omar E. Pol, Sep 12 2021
Sum_{k=1..n} a(k) ~ n*log(n)/2 + (gamma + log(2)/2 - 1/2)*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Nov 27 2022
Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k)/A000005(k) = log(2) (A002162). - Amiram Eldar, Mar 01 2023
a(n) = Sum_{i=1..n} (-1)^(i+1)*A135539(n,i). - Ridouane Oudra, Apr 13 2023
EXAMPLE
G.f. = q + q^2 + 2*q^3 + q^4 + 2*q^5 + 2*q^6 + 2*q^7 + q^8 + 3*q^9 + 2*q^10 + ...
From Omar E. Pol, Nov 30 2020: (Start)
For n = 9 there are three odd divisors of 9; they are [1, 3, 9]. On the other hand there are three partitions of 9 into consecutive parts: they are [9], [5, 4] and [4, 3, 2], so a(9) = 3.
Illustration of initial terms:
Diagram
n a(n) _
1 1 _|1|
2 1 _|1 _|
3 2 _|1 |1|
4 1 _|1 _| |
5 2 _|1 |1 _|
6 2 _|1 _| |1|
7 2 _|1 |1 | |
8 1 _|1 _| _| |
9 3 _|1 |1 |1 _|
10 2 _|1 _| | |1|
11 2 _|1 |1 _| | |
12 2 |1 | |1 | |
...
a(n) is the number of horizontal line segments in the n-th level of the diagram. For more information see A286001. (End)
MAPLE
for n from 1 by 1 to 100 do s := 0: for d from 1 by 2 to n do if n mod d = 0 then s := s+1: fi: od: print(s); od:
A001227 := proc(n) local a, d;
a := 1 ;
for d in ifactors(n)[2] do
if op(1, d) > 2 then
a := a*(op(2, d)+1) ;
end if;
end do:
a ;
end proc: # R. J. Mathar, Jun 18 2015
MATHEMATICA
f[n_] := Block[{d = Divisors[n]}, Count[ OddQ[d], True]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Aug 27 2004 *)
Table[Total[Mod[Divisors[n], 2]], {n, 105}] (* Zak Seidov, Apr 16 2010 *)
f[n_] := Block[{d = DivisorSigma[0, n]}, If[ OddQ@ n, d, d - DivisorSigma[0, n/2]]]; Array[f, 105] (* Robert G. Wilson v *)
a[ n_] := Sum[ Mod[ d, 2], { d, Divisors[ n]}]; (* Michael Somos, May 17 2013 *)
a[ n_] := DivisorSum[ n, Mod[ #, 2] &]; (* Michael Somos, May 17 2013 *)
Count[Divisors[#], _?OddQ]&/@Range[110] (* Harvey P. Dale, Feb 15 2015 *)
(* using a262045 from A262045 to compute a(n) = number of subparts in the symmetric representation of sigma(n) *)
(* cl = current level, cs = current subparts count *)
a001227[n_] := Module[{cs=0, cl=0, i, wL, k}, wL=a262045[n]; k=Length[wL]; For[i=1, i<=k, i++, If[wL[[i]]>cl, cs++; cl++]; If[wL[[i]]<cl, cl--]]; cs]
a001227[105] (* sequence data *) (* Hartmut F. W. Hoft, Dec 16 2016 *)
a[n_] := DivisorSigma[0, n / 2^IntegerExponent[n, 2]]; Array[a, 100] (* Amiram Eldar, Jun 12 2022 *)
PROG
(PARI) {a(n) = sumdiv(n, d, d%2)}; /* Michael Somos, Oct 06 2007 */
(PARI) {a(n) = direuler( p=2, n, 1 / (1 - X) / (1 - kronecker( 4, p) * X))[n]}; /* Michael Somos, Oct 06 2007 */
(PARI) a(n)=numdiv(n>>valuation(n, 2)) \\ Charles R Greathouse IV, Mar 16 2011
(PARI) a(n)=sum(k=1, round(solve(x=1, n, x*(x+1)/2-n)), (k^2-k+2*n)%(2*k)==0) \\ Charles R Greathouse IV, May 31 2013
(PARI) a(n)=sumdivmult(n, d, d%2) \\ Charles R Greathouse IV, Aug 29 2013
(Haskell)
a001227 = sum . a247795_row
-- Reinhard Zumkeller, Sep 28 2014, May 01 2012, Jul 25 2011
(SageMath)
def A001227(n): return len([1 for d in divisors(n) if is_odd(d)])
[A001227(n) for n in (1..80)] # Peter Luschny, Feb 01 2012
(Magma) [NumberOfDivisors(n)/Valuation(2*n, 2): n in [1..100]]; // Vincenzo Librandi, Jun 02 2019
(Python)
from functools import reduce
from operator import mul
from sympy import factorint
def A001227(n): return reduce(mul, (q+1 for p, q in factorint(n).items() if p > 2), 1) # Chai Wah Wu, Mar 08 2021
CROSSREFS
If this sequence counts gapless sets by sum (by Sylvester's enumeration), these sets are ranked by A073485 and A356956. See also A055932, A066311, A073491, A107428, A137921, A333217, A356224, A356841, A356845.
Dirichlet inverse is A327276.
KEYWORD
nonn,easy,nice,mult,core
STATUS
approved
k appears k times; a(n) = floor(sqrt(2n) + 1/2).
(Formerly M0250 N0089)
+0
269
1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13
OFFSET
1,2
COMMENTS
Integer inverse function of the triangular numbers A000217. The function trinv(n) = floor((1+sqrt(1+8n))/2), n >= 0, gives the values 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, ..., that is, the same sequence with offset 0. - N. J. A. Sloane, Jun 21 2009
Array T(k,n) = n+k-1 read by antidiagonals.
Eigensequence of the triangle = A001563. - Gary W. Adamson, Dec 29 2008
Can apparently also be defined via a(n+1)=b(n) for n >= 2 where b(0)=b(1)=1 and b(n) = b(n-b(n-2))+1. Tested to be correct for all n <= 150000. - José María Grau Ribas, Jun 10 2011
For any n >= 0, a(n+1) is the least integer m such that A000217(m)=m(m+1)/2 is larger than n. This is useful when enumerating representations of n as difference of triangular numbers; see also A234813. - M. F. Hasler, Apr 19 2014
Number of binary digits of A023758, i.e., a(n) = ceiling(log_2(A023758(n+2))). - Andres Cicuttin, Apr 29 2016
a(n) and A002260(n) give respectively the x(n) and y(n) coordinates of the sorted sequence of points in the integer lattice such that x(n) > 0, 0 < y(n) <= x(n), and min(x(n), y(n)) < max(x(n+1), y(n+1)) for n > 0. - Andres Cicuttin, Dec 25 2016
Partial sums (A060432) are given by S(n) = (-a(n)^3 + a(n)*(1+6n))/6. - Daniel Cieslinski, Oct 23 2017
As an array, T(k,n) is the number of digits columns used in carryless multiplication between a k-digit number and an n-digit number. - Stefano Spezia, Sep 24 2022
a(n) is the maximum number of possible solutions to an n-statement Knights and Knaves Puzzle, where each statement is of the form "x of us are knights" for some 1 <= x <= n, knights can only tell the truth and knaves can only lie. - Taisha Charles and Brittany Ohlinger, Jul 29 2023
REFERENCES
Edward S. Barbeau, Murray S. Klamkin, and William O. J. Moser, Five Hundred Mathematical Challenges, Prob. 441, pp. 41, 194. MAA 1995.
R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 97.
K. Hardy and K. S. Williams, The Green Book of Mathematical Problems, p. 59, Solution to Prob. 14, Dover NY, 1985
R. Honsberger, Mathematical Morsels, pp. 133-134, MAA 1978.
J. F. Hurley, Litton's Problematical Recreations, pp. 152; 313-4 Prob. 22, VNR Co., NY, 1971.
D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 43.
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).
S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.
LINKS
Franklin T. Adams-Watters, Table of n, a(n) for n = 1..5050
Jaegug Bae and Sungjin Choi, A generalization of a subset-sum-distinct sequence, J. Korean Math. Soc. 40 (2003), no. 5, 757--768. MR1996839 (2004d:05198). See b(n).
Jonathan H. B. Deane and Guido Gentile, A diluted version of the problem of the existence of the Hofstadter sequence, arXiv:2311.13854 [math.NT], 2023. See p. 10.
H. T. Freitag and H. W. Gould, Solution to Problem 571, Math. Mag., 38 (1965), 185-187.
H. T. Freitag (Proposer) and H. W. Gould (Solver), Problem 571: An Ordering of the Rationals, Math. Mag., 38 (1965), 185-187 [Annotated scanned copy]
Mikel Garcia-de-Andoin, Álvaro Saiz, Pedro Pérez-Fernández, Lucas Lamata, Izaskun Oregi, and Mikel Sanz, Digital-Analog Quantum Computation with Arbitrary Two-Body Hamiltonians, arXiv:2307.00966 [quant-ph], 2023.
S. W. Golomb, Discrete chaos: sequences satisfying "strange" recursions, unpublished manuscript, circa 1990 [cached copy, with permission (annotated)]
Abraham Isgur, Vitaly Kuznetsov, and Stephen Tanny, A combinatorial approach for solving certain nested recursions with non-slow solutions, arXiv:1202.0276 [math.CO], 2012.
M. A. Nyblom, Some curious sequences involving floor and ceiling functions, Am. Math. Monthly 109 (#6, 200), 559-564.
Boris Putievskiy, Transformations [Of] Integer Sequences And Pairing Functions, arXiv:1212.2732 [math.CO], 2012.
Raphael Schumacher, Extension of Summation Formulas involving Stirling series, arXiv:1605.09204 [math.NT], 2016.
Raphael Schumacher, The self-counting identity, Fib. Quart., 55 (No. 2 2017), 157-167.
Raphael Schumacher, The Self-Counting Flow, Fibonacci Quart. 60 (2022), no. 5, 324-343.
N. J. A. Sloane, Handwritten notes on Self-Generating Sequences, 1970. (note that A1148 has now become A005282)
Eric Weisstein's World of Mathematics, Self-Counting Sequence.
FORMULA
a(n) = floor(1/2 + sqrt(2n)). Also a(n) = ceiling((sqrt(1+8n)-1)/2). [See the Liu link for a large collection of explicit formulas. - N. J. A. Sloane, Oct 30 2019]
a((k-1)*k/2 + i) = k for k > 0 and 0 < i <= k. - Reinhard Zumkeller, Aug 30 2001
a(n) = a(n - a(n-1)) + 1, with a(1)=1. - Ian M. Levitt (ilevitt(AT)duke.poly.edu), Aug 18 2002
a(n) = round(sqrt(2n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 01 2002
T(n,k) = A003602(A118413(n,k)); = T(n,k) = A001511(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
G.f.: (x/(1-x))*Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, Oct 06 2003
Equals A127899 * A004736. - Gary W. Adamson, Feb 09 2007
Sum_{i=1..n} Sum_{j=i..n+i-1} T(j,i) = A000578(n); Sum_{i=1..n} T(n,i) = A000290(n). - Reinhard Zumkeller, Jun 24 2007
a(n) + n = A014132(n). - Vincenzo Librandi, Jul 08 2010
a(n) = ceiling(-1/2 + sqrt(2n)). - Branko Curgus, May 12 2009
a(A169581(n)) = A038567(n). - Reinhard Zumkeller, Dec 02 2009
a(n) = round(sqrt(2*n)) = round(sqrt(2*n-1)); there exist a and b greater than zero such that 2*n = 2+(a+b)^2 -(a+3*b) and a(n)=(a+b-1). - Fabio Civolani (civox(AT)tiscali.it), Feb 23 2010
A005318(n+1) = 2*A005318(n) - A205744(n), A205744(n) = A005318(A083920(n)), A083920(n) = n - a(n). - N. J. A. Sloane, Feb 11 2012
Expansion of psi(x) * x / (1 - x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Mar 19 2014
G.f.: (x/(1-x)) * Product_{n>=1} (1 + x^n) * (1 - x^(2*n)). - Paul D. Hanna, Feb 27 2016
a(n) = 1 + Sum_{i=1..n/2} ceiling(floor(2(n-1)/(i^2+i))/(2n)). - José de Jesús Camacho Medina, Jan 07 2017
a(n) = floor((sqrt(8*n-7)+1)/2). - Néstor Jofré, Apr 24 2017
a(n) = floor((A000196(8*n)+1)/2). - Pontus von Brömssen, Dec 10 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, Oct 01 2022
G.f. as array: (x^2*(1 - y)^2 + y^2 + x*y*(1 - 2*y))/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Apr 22 2024
EXAMPLE
From Clark Kimberling, Sep 16 2008: (Start)
As a rectangular array, a northwest corner:
1 2 3 4 5 6
2 3 4 5 6 7
3 4 5 6 7 8
4 5 6 7 8 9
This is the weight array (cf. A144112) of A107985 (formatted as a rectangular array). (End)
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^9 + 4*x^9 + 4*x^10 + ...
MAPLE
A002024 := n-> ceil((sqrt(1+8*n)-1)/2); seq(A002024(n), n=1..100);
MATHEMATICA
a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* Branko Curgus, May 12 2009 *)
Table[n, {n, 13}, {n}] // Flatten (* Robert G. Wilson v, May 11 2010 *)
Table[PadRight[{}, n, n], {n, 15}]//Flatten (* Harvey P. Dale, Jan 13 2019 *)
PROG
/* The PARI functions t1, t2 can be used to read a triangular array T(n, k) (n >= 1, 1 <= k <= n) by rows from left to right: n -> T(t1(n), t2(n)).
* The PARI functions t1, t3 can be used to read a triangular array T(n, k) (n >= 1, 1 <= k <= n) by rows from right to left: n -> T(t1(n), t3(n)).
* The PARI functions t1, t4 can be used to read a triangular array T(n, k) (n >= 1, 0 <= k <= n-1) by rows from left to right: n -> T(t1(n), t4(n)).
- Michael Somos, Aug 23, 2002 */
(PARI) t1(n)=floor(1/2+sqrt(2*n)) /* A002024 = this sequence */
(PARI) t2(n)=n-binomial(floor(1/2+sqrt(2*n)), 2) /* A002260(n-1) */
(PARI) t3(n)=binomial(floor(3/2+sqrt(2*n)), 2)-n+1 /* A004736 */
(PARI) t4(n)=n-1-binomial(floor(1/2+sqrt(2*n)), 2) /* A002260(n-1)-1 */
(PARI) A002024(n)=(sqrtint(n*8)+1)\2 \\ M. F. Hasler, Apr 19 2014
(PARI) a(n)=(sqrtint(8*n-7)+1)\2
(PARI) a(n)=my(k=1); while(binomial(k+1, 2)+1<=n, k++); k \\ R. J. Cano, Mar 17 2014
(Haskell)
a002024 n k = a002024_tabl !! (n-1) !! (k-1)
a002024_row n = a002024_tabl !! (n-1)
a002024_tabl = iterate (\xs@(x:_) -> map (+ 1) (x : xs)) [1]
a002024_list = concat a002024_tabl
a002024' = round . sqrt . (* 2) . fromIntegral
-- Reinhard Zumkeller, Jul 05 2015, Feb 12 2012, Mar 18 2011
(Haskell) a002024_list = [1..] >>= \n -> replicate n n
(Haskell) a002024 = (!!) $ [1..] >>= \n -> replicate n n
-- Sascha Mücke, May 10 2016
(Magma) [Floor(Sqrt(2*n) + 1/2): n in [1..80]]; // Vincenzo Librandi, Nov 19 2014
(Sage) [floor(sqrt(2*n) +1/2) for n in (1..80)] # G. C. Greubel, Dec 10 2018
(Python)
from math import isqrt
def A002024(n): return (isqrt(8*n)+1)//2 # Chai Wah Wu, Feb 02 2022
CROSSREFS
a(n+1) = 1+A003056(n), A022846(n)=a(n^2), a(n+1)=A002260(n)+A025581(n).
A123578 is an essentially identical sequence.
KEYWORD
nonn,easy,nice,tabl
STATUS
approved
Triangle read by rows: T(n,k) = k for n >= 1, k = 1..n.
+0
465
1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
OFFSET
1,3
COMMENTS
Old name: integers 1 to k followed by integers 1 to k+1 etc. (a fractal sequence).
Start counting again and again.
This is a "doubly fractal sequence" - see the Franklin T. Adams-Watters link.
The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 1, k >= 1) by antidiagonals downwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Reading this sequence as the antidiagonals of a rectangular array, row n is (n,n,n,...); this is the weight array (Cf. A144112) of the array A127779 (rectangular). - Clark Kimberling, Sep 16 2008
The upper trim of an arbitrary fractal sequence s is s, but the lower trim of s, although a fractal sequence, need not be s itself. However, the lower trim of A002260 is A002260. (The upper trim of s is what remains after the first occurrence of each term is deleted; the lower trim of s is what remains after all 0's are deleted from the sequence s-1.) - Clark Kimberling, Nov 02 2009
Eigensequence of the triangle = A001710 starting (1, 3, 12, 60, 360, ...). - Gary W. Adamson, Aug 02 2010
The triangle sums, see A180662 for their definitions, link this triangle of natural numbers with twenty-three different sequences, see the crossrefs. The mirror image of this triangle is A004736. - Johannes W. Meijer, Sep 22 2010
A002260 is the self-fission of the polynomial sequence (q(n,x)), where q(n,x) = x^n + x^(n-1) + ... + x + 1. See A193842 for the definition of fission. - Clark Kimberling, Aug 07 2011
Sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A002260 is reluctant sequence of sequence 1,2,3,... (A000027). - Boris Putievskiy, Dec 12 2012
This is the maximal sequence of positive integers, such that once an integer k has occurred, the number of k's always exceeds the number of (k+1)'s for the remainder of the sequence, with the first occurrence of the integers being in order. - Franklin T. Adams-Watters, Oct 23 2013
A002260 are the k antidiagonal numerators of rationals in Cantor's proof of 1-to-1 correspondence between rationals and naturals; the denominators are k-numerator+1. - Adriano Caroli, Mar 24 2015
T(n,k) gives the distance to the largest triangular number < n. - Ctibor O. Zizka, Apr 09 2020
REFERENCES
Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168. (Introduces upper trimming, lower trimming, and signature sequences.)
M. Myers, Smarandache Crescendo Subsequences, R. H. Wilde, An Anthology in Memoriam, Bristol Banner Books, Bristol, 1998, p. 19.
F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.
LINKS
Franklin T. Adams-Watters, Doubly Fractal Sequences
Matin Amini and Majid Jahangiri, A Novel Proof for Kimberling’s Conjecture on Doubly Fractal Sequences, arXiv:1612.09481 [math.NT], 2017.
Jerry Brown et al., Problem 4619, School Science and Mathematics (USA), Vol. 97(4), 1997, pp. 221-222.
Glen Joyce C. Dulatre, Jamilah V. Alarcon, Vhenedict M. Florida, and Daisy Ann A. Disu, On Fractal Sequences, DMMMSU-CAS Science Monitor (2016-2017) Vol. 15 No. 2, 109-113.
Clark Kimberling, Fractal sequences
Clark Kimberling, Numeration systems and fractal sequences, Acta Arithmetica 73 (1995) 103-117.
Boris Putievskiy, Transformations Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
Aaron Snook, Augmented Integer Linear Recurrences, 2012. - N. J. A. Sloane, Dec 19 2012
Eric Weisstein's World of Mathematics, Smarandache Sequences.
Eric Weisstein's World of Mathematics, Unit Fraction.
FORMULA
a(n) = 1 + A002262(n).
n-th term is n - m*(m+1)/2 + 1, where m = floor((sqrt(8*n+1) - 1) / 2).
The above formula is for offset 0; for offset 1, use a(n) = n-m*(m+1)/2 where m = floor((-1+sqrt(8*n-7))/2). - Clark Kimberling, Jun 14 2011
a(k * (k + 1) / 2 + i) = i for k >= 0 and 0 < i <= k + 1. - Reinhard Zumkeller, Aug 14 2001
a(n) = (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2. - Brian Tenneson, Oct 11 2003
a(n) = n - binomial(floor((1+sqrt(8*n))/2), 2). - Paul Barry, May 25 2004
T(n,k) = A001511(A118413(n,k)); T(n,k) = A003602(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
a(A000217(n)) = A000217(n) - A000217(n-1), a(A000217(n-1) + 1) = 1, a(A000217(n) - 1) = A000217(n) - A000217(n-1) - 1. - Alexander R. Povolotsky, May 28 2008
a(A169581(n)) = A038566(n). - Reinhard Zumkeller, Dec 02 2009
T(n,k) = Sum_{i=1..k} i*binomial(k,i)*binomial(n-k,n-i) (regarded as triangle, see the example). - Mircea Merca, Apr 11 2012
T(n,k) = Sum_{i=max(0,n+1-2*k)..n-k+1} (i+k)*binomial(i+k-1,i)*binomial(k,n-i-k+1)*(-1)^(n-i-k+1). - Vladimir Kruchinin, Oct 18 2013
G.f.: x*y / ((1 - x) * (1 - x*y)^2) = Sum_{n,k>0} T(n,k) * x^n * y^k. - Michael Somos, Sep 17 2014
EXAMPLE
First six rows:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
MAPLE
at:=0; for n from 1 to 150 do for i from 1 to n do at:=at+1; lprint(at, i); od: od: # N. J. A. Sloane, Nov 01 2006
seq(seq(i, i=1..k), k=1..13); # Peter Luschny, Jul 06 2009
MATHEMATICA
FoldList[{#1, #2} &, 1, Range[2, 13]] // Flatten (* Robert G. Wilson v, May 10 2011 *)
Flatten[Table[Range[n], {n, 20}]] (* Harvey P. Dale, Jun 20 2013 *)
PROG
(PARI) t1(n)=n-binomial(floor(1/2+sqrt(2*n)), 2) /* this sequence */
(PARI) A002260(n)=n-binomial((sqrtint(8*n)+1)\2, 2) \\ M. F. Hasler, Mar 10 2014
(Haskell)
a002260 n k = k
a002260_row n = [1..n]
a002260_tabl = iterate (\row -> map (+ 1) (0 : row)) [1]
-- Reinhard Zumkeller, Aug 04 2014, Jul 03 2012
(Maxima) T(n, k):=sum((i+k)*binomial(i+k-1, i)*binomial(k, n-i-k+1)*(-1)^(n-i-k+1), i, max(0, n+1-2*k), n-k+1); /* Vladimir Kruchinin, Oct 18 2013 */
(Python)
from math import isqrt, comb
def A002260(n): return n-comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)), 2) # Chai Wah Wu, Nov 08 2024
CROSSREFS
Cf. A140756 (alternating signs).
Triangle sums (see the comments): A000217 (Row1, Kn11); A004526 (Row2); A000096 (Kn12); A055998 (Kn13); A055999 (Kn14); A056000 (Kn15); A056115 (Kn16); A056119 (Kn17); A056121 (Kn18); A056126 (Kn19); A051942 (Kn110); A101859 (Kn111); A132754 (Kn112); A132755 (Kn113); A132756 (Kn114); A132757 (Kn115); A132758 (Kn116); A002620 (Kn21); A000290 (Kn3); A001840 (Ca2); A000326 (Ca3); A001972 (Gi2); A000384 (Gi3).
Cf. A108872.
KEYWORD
nonn,easy,nice,tabl,look
AUTHOR
Angele Hamel (amh(AT)maths.soton.ac.uk)
EXTENSIONS
More terms from Reinhard Zumkeller, Apr 27 2006
Incorrect program removed by Franklin T. Adams-Watters, Mar 19 2010
New name from Omar E. Pol, Jul 15 2012
STATUS
approved
Triangle read by rows: T(n,k) = k, 0 <= k <= n, in which row n lists the first n+1 nonnegative integers.
+0
238
0, 0, 1, 0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
OFFSET
0,6
COMMENTS
The point with coordinates (x = A025581(n), y = A002262(n)) sweeps out the first quadrant by upwards antidiagonals. N. J. A. Sloane, Jul 17 2018
Old name: Integers 0 to n followed by integers 0 to n+1 etc.
a(n) = n - the largest triangular number <= n. - Amarnath Murthy, Dec 25 2001
The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 0, k >= 0) by antidiagonals downwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Values x of unique solution pair (x,y) to equation T(x+y) + x = n, where T(k)=A000217(k). - Lekraj Beedassy, Aug 21 2004
a(A000217(n)) = 0; a(A000096(n)) = n. - Reinhard Zumkeller, May 20 2009
Concatenation of the set representation of ordinal numbers, where the n-th ordinal number is represented by the set of all ordinals preceding n, 0 being represented by the empty set. - Daniel Forgues, Apr 27 2011
An integer sequence is nonnegative if and only if it is a subsequence of this sequence. - Charles R Greathouse IV, Sep 21 2011
a(A195678(n)) = A000040(n) and a(m) <> A000040(n) for m < A195678(n), an example of the preceding comment. - Reinhard Zumkeller, Sep 23 2011
A sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. A002262 is reluctant sequence of 0,1,2,3,... The nonnegative integers, A001477. - Boris Putievskiy, Dec 12 2012
LINKS
Charles R Greathouse IV, Rows n = 0..100, flattened
Boris Putievskiy, Transformations [Of] Integer Sequences And Pairing Functions, arXiv preprint arXiv:1212.2732 [math.CO], 2012.
FORMULA
a(n) = A002260(n) - 1.
a(n) = n - (trinv(n)*(trinv(n)-1))/2; trinv := n -> floor((1+sqrt(1+8*n))/2) (cf. A002024); # gives integral inverses of triangular numbers
a(n) = n - A000217(A003056(n)) = n - A057944(n). - Lekraj Beedassy, Aug 21 2004
a(n) = A140129(A023758(n+2)). - Reinhard Zumkeller, May 14 2008
a(n) = f(n,1) with f(n,m) = if n<m then n else f(n-m,m+1). - Reinhard Zumkeller, May 20 2009
a(n) = (1/2)*(t - t^2 + 2*n), where t = floor(sqrt(2*n+1) + 1/2) = round(sqrt(2*n+1)). - Ridouane Oudra, Dec 01 2019
a(n) = ceiling((-1 + sqrt(9 + 8*n))/2) * (1 - ((1/2)*ceiling((1 + sqrt(9 + 8*n))/2))) + n. - Ryan Jean, Sep 03 2022
G.f.: x*y/((1 - x)*(1 - x*y)^2). - Stefano Spezia, Feb 21 2024
EXAMPLE
From Daniel Forgues, Apr 27 2011: (Start)
Examples of set-theoretic representation of ordinal numbers:
0: {}
1: {0} = {{}}
2: {0, 1} = {0, {0}} = {{}, {{}}}
3: {0, 1, 2} = {{}, {0}, {0, 1}} = ... = {{}, {{}}, {{}, {{}}}} (End)
From Omar E. Pol, Jul 15 2012: (Start)
0;
0, 1;
0, 1, 2;
0, 1, 2, 3;
0, 1, 2, 3, 4;
0, 1, 2, 3, 4, 5;
0, 1, 2, 3, 4, 5, 6;
0, 1, 2, 3, 4, 5, 6, 7;
0, 1, 2, 3, 4, 5, 6, 7, 8;
0, 1, 2, 3, 4, 5, 6, 7, 8, 9;
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
(End)
MAPLE
seq(seq(i, i=0..n), n=0..14); # Peter Luschny, Sep 22 2011
A002262 := n -> n - binomial(floor((1/2)+sqrt(2*(1+n))), 2);
MATHEMATICA
m[n_]:= Floor[(-1 + Sqrt[8n - 7])/2]
b[n_]:= n - m[n] (m[n] + 1)/2
Table[m[n], {n, 1, 105}] (* A003056 *)
Table[b[n], {n, 1, 105}] (* A002260 *)
Table[b[n] - 1, {n, 1, 120}] (* A002262 *)
(* Clark Kimberling, Jun 14 2011 *)
Flatten[Table[k, {n, 0, 14}, {k, 0, n}]] (* Alonso del Arte, Sep 21 2011 *)
Flatten[Table[Range[0, n], {n, 0, 15}]] (* Harvey P. Dale, Jan 31 2015 *)
PROG
(PARI) a(n)=n-binomial(round(sqrt(2+2*n)), 2)
(PARI) t1(n)=n-binomial(floor(1/2+sqrt(2+2*n)), 2) /* A002262, this sequence */
(PARI) t2(n)=binomial(floor(3/2+sqrt(2+2*n)), 2)-(n+1) /* A025581, cf. comment by Somos for reading arrays by antidiagonals */
(PARI) concat(vector(15, n, vector(n, i, i-1))) \\ M. F. Hasler, Sep 21 2011
(PARI) apply( {A002262(n)=n-binomial(sqrtint(8*n+8)\/2, 2)}, [0..99]) \\ M. F. Hasler, Oct 20 2022
(Haskell)
a002262 n k = a002262_tabl !! n !! k
a002262_row n = a002262_tabl !! n
a002262_tabl = map (enumFromTo 0) [0..]
a002262_list = concat a002262_tabl
-- Reinhard Zumkeller, Aug 05 2015, Jul 13 2012, Mar 07 2011
(Python)
for i in range(16):
for j in range(i):
print(j, end=", ") # Mohammad Saleh Dinparvar, May 13 2020
(Python)
from math import comb, isqrt
def a(n): return n - comb((1+isqrt(8+8*n))//2, 2)
print([a(n) for n in range(105)]) # Michael S. Branicky, May 07 2023
CROSSREFS
As a sequence, essentially same as A048151.
Cf. A060510 (parity).
KEYWORD
nonn,tabl,easy,nice
AUTHOR
Angele Hamel (amh(AT)maths.soton.ac.uk)
EXTENSIONS
New name from Omar E. Pol, Jul 15 2012
Typo in definition fixed by Reinhard Zumkeller, Aug 05 2015
STATUS
approved

Search completed in 0.213 seconds