Displaying 1-10 of 51 results found.
1, 4, 7, 11, 17, 20, 26, 35, 38, 45, 54, 60, 69, 78, 84, 90, 105, 114, 121, 133, 136, 151, 166, 172, 184, 196, 205, 217, 232, 238, 251, 272, 284, 290, 305, 314, 326, 350, 359, 377, 389, 398, 416, 431, 443, 456, 480
FORMULA
G.f.: theta_2(sqrt(x))^3/(8*x^(3/8)*(1 - x)), where theta_2() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 15 2018
a(n) = 1 if n is a triangular number, otherwise 0.
+10
1570
1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
COMMENTS
This is essentially the q-expansion of the Jacobi theta function theta_2(q). (In theta_2 one has to ignore the initial factor of 2*q^(1/4) and then replace q by q^(1/2). See also A005369.) - N. J. A. Sloane, Aug 03 2014
Ramanujan's theta function f(a, b) = Sum_{n=-inf..inf} a^(n*(n+1)/2) * b^(n*(n-1)/2).
This sequence is the concatenation of the base-b digits in the sequence b^n, for any base b >= 2. - Davis Herring (herring(AT)lanl.gov), Nov 16 2004
Number of partitions of n into distinct parts such that the greatest part equals the number of all parts, see also A047993; a(n)= A117195(n,0) for n > 0; a(n) = 1- A117195(n,1) for n > 1. - Reinhard Zumkeller, Mar 03 2006
Polcoeff inverse with alternate signs = A006950: (1, 1, 1, 2, 3, 4, 5, 7, ...). - Gary W. Adamson, Mar 15 2010
This sequence is related to Ramanujan's two-variable theta functions because this sequence is also the characteristic function of generalized hexagonal numbers. - Omar E. Pol, Jun 08 2012
Number 3 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016
Number of partitions of n into consecutive parts that contain 1 as a part, n >= 1. - Omar E. Pol, Nov 27 2020
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 103.
M. D. Hirschhorn, The Power of q, Springer, 2017. See Psi page 9.
J. Tannery and J. Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
E. T. Whittaker and G. N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.
FORMULA
Expansion of f(x, x^3) in powers of x where f(, ) is Ramanujan's general theta function.
Expansion of q^(-1) * (phi(q) - phi(q^4)) / 2 in powers of q^8. - Michael Somos, Jul 01 2014
Expansion of q^(-1/8) * eta(q^2)^2 / eta(q) in powers of q. - Michael Somos, Apr 13 2005
Euler transform of period 2 sequence [ 1, -1, ...]. - Michael Somos, Mar 24 2003
Given g.f. A(x), then B(q) = q * A(q^8) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u6^3 + u2*u3^3 - u1*u2^2*u6. - Michael Somos, Apr 13 2005
a(n) = b(8*n + 1) where b()= A098108() is multiplicative with b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p > 2. - Michael Somos, Jun 06 2005
G.f.: theta_2(sqrt(q)) / (2 * q^(1/8)).
G.f.: 1 / (1 - x / (1 + x / (1 + x^1 / (1 - x / (1 + x / (1 + x^2 / (1 - x / (1 + x / (1 + x^3 / ...))))))))). - Michael Somos, May 11 2012
G.f.: Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, May 02 2002
G.f.: Sum_{j>=0} Product_{k=0..j} x^j. - Jon Perry, Mar 30 2004
a(n) = floor((1-cos(Pi*sqrt(8*n+1)))/2). - Carl R. White, Mar 18 2006
a(n) = f(n,0) with f(x,y) = if x > 0 then f(x-y,y+1), otherwise 0^(-x). - Reinhard Zumkeller, Sep 27 2008
Since the characteristic function of s-gonal numbers is given by floor(sqrt(2n/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)) - floor(sqrt(2(n-1)/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)), by setting s = 3 we get the following: For n > 0, a(n) = floor(sqrt(2*n+1/4)-1/2) - floor(sqrt(2*(n-1)+1/4)-1/2).
(End)
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A002448. - Michael Somos, May 05 2016
G.f.: Sum_{n >= 0} x^(n*(n+1)/2) = Product_{n >= 1} (1 - x^n)*(1 + x^n)^2 = Product_{n >= 1} (1 - x^(2*n))*(1 + x^n) = Product_{n >= 1} (1 - x^(2*n))/(1 - x^(2*n-1)). From the sum and product representations of theta_2(0, sqrt(q))/(2*q^(1/8))) function. The last product, given by Vladeta Jovovic above, is obtained from the second to last one by an Euler identity, proved via f(x) := Product_{n >= 1} (1 - x^(2*n-1))*Product_{n >= 1} (1 + x^n) = f(x^2), by moving the odd-indexed factors of the second product to the first product. This leads to f(x) = f(0) = 1. - Wolfdieter Lang, Jul 05 2016
EXAMPLE
G.f. = 1 + x + x^3 + x^6 + x^10 + x^15 + x^21 + x^28 + x^36 + x^45 + x^55 + x^66 + ...
G.f. for B(q) = q * A(q^8): q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + q^361 + ...
As a triangle this begins:
1;
1, 0;
1, 0, 0;
1, 0, 0, 0;
1, 0, 0, 0, 0;
1, 0, 0, 0, 0, 0;
... (End)
MAPLE
if issqr(1+8*n) then
1;
else
0;
end if;
end proc:
MATHEMATICA
a[ n_] := SquaresR[ 1, 8 n + 1] / 2; (* Michael Somos, Nov 15 2011 *)
a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (Series[ EllipticTheta[ 3, Log[y] / (2 I), x^2], {x, 0, n + Floor @ Sqrt[n]}] // Normal // TrigToExp) /. {y -> x}, {x, 0, n}]]; (* Michael Somos, Nov 15 2011 *)
Table[If[IntegerQ[(Sqrt[8n+1]-1)/2], 1, 0], {n, 0, 110}] (* Harvey P. Dale, Oct 29 2012 *)
a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)] / (2 q^(1/8)), {q, 0, n}]; (* Michael Somos, Jul 01 2014 *)
Module[{tr=Accumulate[Range[20]]}, If[MemberQ[tr, #], 1, 0]&/@Range[Max[tr]]] (* Harvey P. Dale, Mar 13 2023 *)
PROG
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^2 / eta(x + A), n))}; /* Michael Somos, Mar 14 2011 */
(PARI) {a(n) = issquare( 8*n + 1)}; /* Michael Somos, Apr 27 2000 */
(Haskell)
a010054 = a010052 . (+ 1) . (* 8)
a010054_list = concatMap (\x -> 1 : replicate x 0) [0..]
(Magma) Basis( ModularForms( Gamma0(16), 1/2), 362) [2] ; /* Michael Somos, Jun 10 2014 */
(Python)
from sympy import integer_nthroot
(Sage) # uses[EulerTransform from A166861]
b = BinaryRecurrenceSequence(-1, 0)
a = EulerTransform(b)
(Clojure)
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Theta series of simple cubic lattice; also number of ways of writing a nonnegative integer n as a sum of 3 squares (zero being allowed).
(Formerly M4092)
+10
82
1, 6, 12, 8, 6, 24, 24, 0, 12, 30, 24, 24, 8, 24, 48, 0, 6, 48, 36, 24, 24, 48, 24, 0, 24, 30, 72, 32, 0, 72, 48, 0, 12, 48, 48, 48, 30, 24, 72, 0, 24, 96, 48, 24, 24, 72, 48, 0, 8, 54, 84, 48, 24, 72, 96, 0, 48, 48, 24, 72, 0, 72, 96, 0, 6, 96, 96, 24, 48, 96, 48, 0, 36, 48, 120
COMMENTS
Number of ordered triples (i, j, k) of integers such that n = i^2 + j^2 + k^2.
The Madelung Coulomb energy for alternating unit charges in the simple cubic lattice is Sum_{n>=1} (-1)^n*a(n)/sqrt(n) = - A085469. - R. J. Mathar, Apr 29 2006
a( A004215(k))=0 for k=1,2,3,... but no other elements of {a(n)} are zero. - Graeme McRae, Jan 15 2007
REFERENCES
H. Cohen, Number Theory, Vol. 1: Tools and Diophantine Equations, Springer-Verlag, 2007, p. 317.
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, Chapter V.
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. 3, p. 109.
E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 54.
L. Kronecker, Crelle, Vol. LVII (1860), p. 248; Werke, Vol. IV, p. 188.
C. J. Moreno and S. S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 43.
T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p.61).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
H. J. S. Smith, Report on the Theory of Numbers, reprinted in Vol. 1 of his Collected Math. Papers, Chelsea, NY, 1979, see p. 338, Eq. (B').
FORMULA
A number n is representable as the sum of 3 squares iff n is not of the form 4^a (8k+7) (cf. A000378).
There is a classical formula (essentially due to Gauss):
For sums of 3 squares r_3(n): write (uniquely) -n=D(2^vf)^2, with D<0 fundamental discriminant, f odd, v>=-1. Then r_3(n) = 12L((D/.),0)(1-(D/2)) Sum_{d | f} mu(d)(D/d)sigma(f/d).
Here mu is the Moebius function, (D/2) and (D/d) are Kronecker-Legendre symbols, sigma is the sum of divisors function, L((D/.),0)=h(D)/(w(D)/2) is the value at 0 of the L function of the quadratic character (D/.), equal to the class number h(D) divided by 2 or 3 in the special cases D=-4 and -3. - Henri Cohen (Henri.Cohen(AT)math.u-bordeaux1.fr), May 12 2010
a(n) = 3*T(n) if n == 1,2,5,6 mod 8, = 2*T(n) if n == 3 mod 8, = 0 if n == 7 mod 8 and = a(n/4) if n == 0 mod 4, where T(n) = A117726(n). [Moreno-Wagstaff].
"If 12E(n) is the number of representations of n as a sum of three squares, then E(n) = 2F(n) - G(n) where G(n) = number of classes of determinant -n, F(n) = number of uneven classes." - Dickson, quoting Kronecker. [Cf. A117726.]
a(n) = Sum_{d^2|n} b(n/d^2), where b() = A074590() gives the number of primitive solutions.
Expansion of phi(q)^3 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006.
Euler transform of period 4 sequence [ 6, -9, 6, -3, ...]. - Michael Somos, Oct 25 2006
G.f.: (Sum_{k in Z} x^(k^2))^3.
a(8*n + 7) = 0. a(4*n) = a(n).
EXAMPLE
Order and signs are taken into account: a(1) = 6 from 1 = (+-1)^2 + 0^2 + 0^2, a(2) = 12 from 2 = (+-1)^2 + (+-1)^2 + 0^2; a(3) = 8 from 3 = (+-1)^2 + (+-1)^2 + (+-1)^2, etc.
G.f. = 1 + 6*q + 12*q^2 + 8*q^3 + 6*q^4 + 24*q^5 + 24*q^6 + 12*q^8 + 30*q^9 + 24*q^10 + ...
MAPLE
(sum(x^(m^2), m=-10..10))^3; seq(coeff(%, x, n), n=0..50);
Alternative:
A005875list := proc(len) series(JacobiTheta3(0, x)^3, x, len+1);
seq(coeff(%, x, j), j=0..len-1) end: A005875list(75); # Peter Luschny, Oct 02 2018
MATHEMATICA
a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3, {q, 0, n}]; (* Michael Somos, Jun 25 2014 *)
a[ n_] := Length @ FindInstance[ n == x^2 + y^2 + z^2, {x, y, z}, Integers, 10^9]; (* Michael Somos, May 21 2015 *)
QP = QPochhammer; CoefficientList[(QP[q^2]^5/(QP[q]*QP[q^4])^2)^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))};
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2)^3, n))}; /* Michael Somos, Jun 03 2012 */
(PARI) {a(n) = my(G); if( n<0, 0, G = [ 1, 0, 0; 0, 1, 0; 0, 0, 1]; polcoeff( 1 + 2 * x * Ser( qfrep( G, n)), n))}; /* Michael Somos, May 21 2015 */
(Sage)
Q = DiagonalQuadraticForm(ZZ, [1]*3)
(Magma) Basis( ModularForms( Gamma1(4), 3/2), 75) [1]; /* Michael Somos, Jun 25 2014 */
(Julia) # JacobiTheta3 is defined in A000122.
A005875List(len) = JacobiTheta3(len, 3)
(Python)
from math import isqrt
Sum of divisors of 2*n + 1.
+10
75
1, 4, 6, 8, 13, 12, 14, 24, 18, 20, 32, 24, 31, 40, 30, 32, 48, 48, 38, 56, 42, 44, 78, 48, 57, 72, 54, 72, 80, 60, 62, 104, 84, 68, 96, 72, 74, 124, 96, 80, 121, 84, 108, 120, 90, 112, 128, 120, 98, 156, 102, 104, 192, 108, 110, 152, 114, 144, 182, 144, 133, 168
COMMENTS
Number of ways of writing n as the sum of 4 triangular numbers.
a(n) is also the total number of parts in all partitions of 2*n + 1 into equal parts. - Omar E. Pol, Feb 14 2021
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 139 Ex. (iii).
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
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. 19 eq. (6), and p. 283 eq. (8).
W. Dunham, Euler: The Master of Us All, The Mathematical Association of America Inc., Washington, D.C., 1999, p. 12.
H. M. Farkas, I. Kra, Cosines and triangular numbers, Rev. Roumaine Math. Pures Appl., 46 (2001), 37-43.
N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 79, Eq. (32.31).
N. Koblitz, Introduction to Elliptic Curves and Modular Forms, Springer-Verlag, 1984, see p. 184, Prop. 4, F(z).
G. Polya, Induction and Analogy in Mathematics, vol. 1 of Mathematics and Plausible Reasoning, Princeton Univ. Press, 1954, page 92 ff.
FORMULA
Expansion of q^(-1/2) * (eta(q^2)^2 / eta(q))^4 = psi(q)^4 in powers of q where psi() is a Ramanujan theta function. - Michael Somos, Apr 11 2004
Expansion of Jacobi theta_2(q)^4 / (16*q) in powers of q^2. - Michael Somos, Apr 11 2004
Euler transform of period 2 sequence [4, -4, 4, -4, ...]. - Michael Somos, Apr 11 2004
a(n) = b(2*n + 1) where b() is multiplicative and b(2^e) = 0^n, b(p^e) =(p^(e+1) - 1) / (p - 1) if p>2. - Michael Somos, Jul 07 2004
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 + 8*w*v^2 + 16*w^2*v - u^2*w - Michael Somos, Apr 08 2005
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^3), B(q^9)) where f(u, v, w) = v^4 - 30*u*v^2*w + 12*u*v*w*(u + 9*w) - u*w*(u^2 + 9*w*u + 81*w^2).
Given g.f. A(x), then B(q) = q * A(q^2) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u2^3 + u1^2*u6 + 3*u2*u3^2 + 27*u6^3 - u1*u2*u3 - 3*u1*u3*u6 - 7*u2^2*u6 - 21*u2*u6^2. - Michael Somos, May 30 2005
G.f.: Sum_{k>=0} (2k + 1) * x^k / (1 - x^(2k + 1)).
G.f.: (Product_{k>0} (1 - x^k) * (1 + x^k)^2)^4. - Michael Somos, Apr 11 2004
G.f. Sum_{k>=0} a(k) * x^(2k + 1) = x( * Prod_{k>0} (1 - x^(4*k))^2 / (1 - x^(2k)))^ 4 = x * (Sum_{k>0} x^(k^2 - k))^4 = Sum_{k>0} k * (x^k / (1 - x^k) - 3 * x^(2*k) / (1 - x^(2*k)) +2 * x^(4*k) / (1 - x^(4*k))). - Michael Somos, Jul 07 2004
Number of solutions of 2*n + 1 = (x^2 + y^2 + z^2 + w^2) / 4 in positive odd integers. - Michael Somos, Apr 11 2004
G.f. is a period 1 Fourier series which satisfies f(-1 / (4 t)) = (1/4) (t/i)^2 g(t) where q = exp(2 Pi i t) and g() is the g.f. for A096727. Michael Somos, Jun 12 2014
G.f.: Sum_{n >= 0} x^n*(1 + x^(2*n+1))/(1 - x^(2*n+1))^2. (End)
EXAMPLE
Divisors of 9 are 1,3,9, so a(4)=1+3+9=13.
F_2(z) = eta(4z)^8/eta(2z)^4 = q + 4q^3 + 6q^5 +8q^7 + 13q^9 + ...
G.f. = 1 + 4*x + 6*x^2 + 8*x^3 + 13*x^4 + 12*x^5 + 14*x^6 + 24*x^7 + 18*x^8 + 20*x^9 + ...
B(q) = q + 4*q^3 + 6*q^5 + 8*q^7 + 13*q^9 + 12*q^11 + 14*q^13 + 24*q^15 + 18*q^17 + ...
MATHEMATICA
DivisorSigma[1, 2 # + 1] & /@ Range[0, 61] (* Ant King, Dec 02 2010 *)
a[ n_] := SeriesCoefficient[ D[ Series[ Log[ QPochhammer[ -x] / QPochhammer[ x]], {x, 0, 2 n + 1}], x], {x, 0 , 2n}]; (* Michael Somos, Oct 15 2019 *)
PROG
(PARI) {a(n) = if( n<0, 0, sigma( 2*n + 1))};
(PARI) {a(n) = if( n<0, 0, n = 2*n; polcoeff( sum( k=1, (sqrtint( 4*n + 1) + 1)\2, x^(k^2 - k), x * O(x^n))^4, n))}; /* Michael Somos, Sep 17 2004 */
(PARI) {a(n) = my(A); if( n<0, 0, n = 2*n; A = x * O(x^n); polcoeff( (eta(x^4 + A)^2 / eta(x^2 + A))^4, n))}; /* Michael Somos, Sep 17 2004 */
(Sage) ModularForms( Gamma0(4), 2, prec=124).1; # Michael Somos, Jun 12 2014
(Magma) Basis( ModularForms( Gamma0(4), 2), 124) [2]; /* Michael Somos, Jun 12 2014 */
(Haskell)
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Number of ways of writing n as the sum of 2 triangular numbers.
+10
67
1, 2, 1, 2, 2, 0, 3, 2, 0, 2, 2, 2, 1, 2, 0, 2, 4, 0, 2, 0, 1, 4, 2, 0, 2, 2, 0, 2, 2, 2, 1, 4, 0, 0, 2, 0, 4, 2, 2, 2, 0, 0, 3, 2, 0, 2, 4, 0, 2, 2, 0, 4, 0, 0, 0, 4, 3, 2, 2, 0, 2, 2, 0, 0, 2, 2, 4, 2, 0, 2, 2, 0, 3, 2, 0, 0, 4, 0, 2, 2, 0, 6, 0, 2, 2, 0, 0, 2, 2, 0, 1, 4, 2, 2, 4, 0, 0, 2, 0, 2, 2, 2, 2, 0, 0
COMMENTS
Ramanujan theta functions: f(q) (see A121373), phi(q) ( A000122), psi(q) ( A010054), chi(q) ( A000700). The present sequence gives the expansion coefficients of psi(q)^2.
Also the number of positive odd solutions to equation x^2 + y^2 = 8*n + 2. - Seiichi Manyama, May 28 2017
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag. See p. 139 Example (iv).
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
R. W. Gosper, Strip Mining in the Abandoned Orefields of Nineteenth Century Mathematics, in Computers in Mathematics (Ed. D. V. Chudnovsky and R. D. Jenks). New York: Dekker, 1990. See p. 279.
R. W. Gosper, Experiments and discoveries in q-trigonometry, in Symbolic Computation, Number Theory, Special Functions, Physics and Combinatorics. Editors: F. G. Garvan and M. E. H. Ismail. Kluwer, Dordrecht, Netherlands, 2001, pp. 79-105. [See Pi_q.]
P. A. MacMahon, Combinatory Analysis, Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916. See vol. 2, p 31, Article 272.
Ivan Niven, Herbert S. Zuckerman and Hugh L. Montgomery, An Introduction to the Theory Of Numbers, Fifth Edition, John Wiley and Sons, Inc., NY 1991, p. 165.
LINKS
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, Tenth Printing, 1972, p. 575, 16.23.1 and 16.23.2.
J. W. L. Glaisher, On the function chi(n), Quarterly Journal of Pure and Applied Mathematics, 20 (1884), 97-167. See p. 108.
FORMULA
This sequence is the quadrisection of many sequences. Here are two examples:
a(n) = A002654(4n+1), the difference between the number of divisors of 4*n+1 of form 4*k+1 and the number of form 4*k-1. - David Broadhurst, Oct 20 2002
a(n) = b(4*n + 1), where b(n) is multiplicative and b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p == 3 (mod 4), b(p^e) = e+1 if p == 1 (mod 4). - Michael Somos, Sep 14 2005
G.f.: (Sum_{k>=0} x^((k^2 + k)/2))^2 = (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k in Z} x^(k^2)).
Expansion of Jacobi theta (theta_2(0, sqrt(q)))^2 / (4 * q^(1/4)).
Sum[d|(4n+1), (-1)^((d-1)/2) ].
Given g.f. A(x), then B(q) = q * A(q^4) satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = v^3 + 4 * v * w^2 - u^2 * w. - Michael Somos, Sep 14 2005
Given g.f. A(x), then B(q) = q * A(q^4) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1 * u3 - (u2 - u6) * (u2 + 3*u6). - Michael Somos, Sep 14 2005
Expansion of Jacobi k/(4*q^(1/2)) * (2/Pi)* K(k) in powers of q^2. - Michael Somos, Sep 14 2005. Convolution of A001938 and A004018. This appears in the denominator of the Jacobi sn and cn formula given in the Abramowitz-Stegun reference, p. 575, 16.23.1 and 16.23.2, where m=k^2. - Wolfdieter Lang, Jul 05 2016
G.f.: Sum_{k>=0} a(k) * x^(2*k) = Sum_{k>=0} x^k / (1 + x^(2*k + 1)).
G.f.: Sum_{k in Z} x^k / (1 - x^(4*k + 1)). - Michael Somos, Nov 03 2005
Expansion of psi(x)^2 = phi(x) * psi(x^2) in powers of x where phi(), psi() are Ramanujan theta functions.
Moebius transform is period 8 sequence [ 1, -1, -1, 0, 1, 1, -1, 0, ...]. - Michael Somos, Jan 25 2008
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 1/2 (t/i) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A104794.
Euler transform of period 2 sequence [ 2, -2, ...].
G.f.: q^(-1/4) * eta(q^2)^4 / eta(q)^2. See also the Fine reference.
G.f.: Product_{k>0} (1 - x^(2*k))^2 / (1 - x^(2*k-1))^2.
G.f.: exp( Sum_{n>=1} 2*(x^n/n) / (1 + x^n) ). - Paul D. Hanna, Mar 01 2016
a(n) = A001826(2+8*n) - A001842(2+8*n), the difference between the number of divisors 1 (mod 4) and 3 (mod 4) of 2+8*n. See the Ono et al. link, Corollary 1, or directly the Niven et al. reference, p. 165, Corollary (3.23). - Wolfdieter Lang, Jan 11 2017
Expansion of continued fraction 1 / (1 - x^1 + x^1*(1 - x^1)^2 / (1 - x^3 + x^2*(1 - x^2)^2 / (1 - x^5 + x^3*(1 - x^3)^2 / ...))) in powers of x^2. - Michael Somos, Apr 20 2017
Given g.f. A(x), and B(x) is the g.f. for A079006, then B(x) = A(x^2) / A(x) and B(x) * B(x^2) * B(x^4) * ... = 1 / A(x). - Michael Somos, Apr 20 2017
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(2*n+1) - x^(2*k))^(n-k) = Sum_{n>=0} a(n)*x^(2*n).
G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} binomial(n,k) * (x^(2*n+1) + x^(2*k))^(n-k) * (-1)^k = Sum_{n>=0} a(n)*x^(2*n). (End)
G.f.: Sum_{n = -oo..oo} x^(4*n^2+2*n) * (1 + x^(4*n+1))/(1 - x^(4*n+1)). See Agarwal, p. 285, equation 6.20 with i = j = 1 and mu = 4.
For prime p of the form 4*k + 3, a(n*p^2 + (p^2 - 1)/4) = a(n).
If n > 0 and p are coprime then a(n*p + (p^2 - 1)/4) = 0. The proofs are similar to those given for the corresponding results for A115110. Cf. A000729.
For prime p of the form 4*k + 1 and for n not congruent to (p - 1)/4 (mod p) we have a(n*p^2 + (p^2 - 1)/4) = 3*a(n) (since b(n), where b(4*n+1) = a(n), is multiplicative). (End)
G.f. A(q) satisfies:
A(q^2) = Sum_{n = -oo..oo} q^n/(1 - q^(4*n+2)) (set z = q, alpha = q^2, mu = 4 in Agarwal, equation 6.15).
A(q^2) = Sum_{n = -oo..oo} q^(2*n)/(1 - q^(4*n+1)) (set z = q^2, alpha = q, mu = 4 in Agarwal, equation 6.15).
A(q^2) = Sum_{n = -oo..oo} q^n/(1 + q^(2*n+1))^2 = Sum_{n = -oo..oo} q^(3*n+1)/(1 + q^(2*n+1))^2. (End)
G.f.: Sum_{k>=0} a(k) * q^k = Sum_{k>=0} (-1)^k * q^(k*(k+1)) + 2 * Sum_{n>=1, k>=0} (-1)^k * q^(k*(k+2*n+1)+n). - Mamuka Jibladze, May 17 2021
G.f.: Sum_{k>=0} a(k) * q^k = Sum_{k>=0} (-1)^k * q^(k*(k+1)) * (1 + q^(2*k+1))/(1 - q^(2*k+1)). - Mamuka Jibladze, Jun 06 2021
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/2 ( A019669). - Amiram Eldar, Oct 15 2022
EXAMPLE
G.f. = 1 + 2*x + x^2 + 2*x^3 + 2*x^4 + 3*x^6 + 2*x^7 + 2*x^9 + 2*x^10 + 2*x^11 + ...
G.f. for B(q) = q * A(q^4) = q + 2*q^5 + q^9 + 2*q^13 + 2*q^17 + 3*q^25 + 2*q^29 + 2*q^37 + 2*q^41 + ...
MAPLE
sigmamr := proc(n, m, r) local a, d ; a := 0 ; for d in numtheory[divisors](n) do if modp(d, m) = r then a := a+1 ; end if; end do: a; end proc:
A002654 := proc(n) sigmamr(n, 4, 1)-sigmamr(n, 4, 3) ; end proc:
MATHEMATICA
Plus@@((-1)^(1/2 (Divisors[4#+1]-1)))& /@ Range[0, 104] (* Ant King, Dec 02 2010 *)
a[ n_] := SeriesCoefficient[ (1/2) EllipticTheta[ 2, 0, q] EllipticTheta[ 3, 0, q], {q, 0, n + 1/4}]; (* Michael Somos, Jun 19 2012 *)
a[ n_] := SeriesCoefficient[ (1/4) EllipticTheta[ 2, 0, q]^2, {q, 0, 2 n + 1/2}]; (* Michael Somos, Jun 19 2012 *)
a[ n_] := If[ n < 0, 0, DivisorSum[ 4 n + 1, (-1)^Quotient[#, 2] &]]; (* Michael Somos, Jun 08 2014 *)
QP = QPochhammer; s = QP[q^2]^4/QP[q]^2 + O[q]^100; CoefficientList[s, q] (* Jean-François Alcover, Nov 27 2015, adapted from PARI *)
TriangeQ[n_] := IntegerQ@Sqrt[8n +1]; Table[Count[FrobeniusSolve[{1, 1}, n], {__?TriangeQ}], {n, 0, 104}] (* Robert G. Wilson v, Apr 15 2017 *)
PROG
(PARI) {a(n) = if( n<1, n==0, polcoeff( sum(k=0, (sqrtint(8*n + 1) - 1)\2, x^(k * (k+1)/2), x * O(x^n))^2, n) )};
(PARI) {a(n) = if( n<0, 0, n = 4*n + 1; sumdiv(n, d, (-1)^(d\2)))}; /* Michael Somos, Sep 02 2005 */
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^4 / eta(x + A)^2, n))};
(PARI) {a(n) = if( n<0, 0, n = 4*n + 1; sumdiv( n, d, (d%4==1) - (d%4==3)))}; /* Michael Somos, Sep 14 2005 */
(PARI) { my(q='q+O('q^166)); Vec(eta(q^2)^4 / eta(q)^2) } \\ Joerg Arndt, Apr 16 2017
(Sage) ModularForms( Gamma1(8), 1, prec=420).1; # Michael Somos, Jun 08 2014
(Haskell)
a052343 = (flip div 2) . (+ 1) . a008441
(Magma) A := Basis( ModularForms( Gamma1(8), 1), 420); A[2]; /* Michael Somos, Jan 31 2015 */
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Fourier coefficients of E_{infinity,4}.
(Formerly M4503)
+10
41
0, 1, 8, 28, 64, 126, 224, 344, 512, 757, 1008, 1332, 1792, 2198, 2752, 3528, 4096, 4914, 6056, 6860, 8064, 9632, 10656, 12168, 14336, 15751, 17584, 20440, 22016, 24390, 28224, 29792, 32768, 37296, 39312, 43344, 48448, 50654, 54880, 61544, 64512
COMMENTS
E_{infinity,4} is the unique normalized weight-4 modular form for Gamma_0(2) with simple zeros at i*infinity. Since this has level 2, it is not a cusp form, in contrast to A002408.
a(n+1) is the number of representations of n as a sum of 8 triangular numbers (from A000217). See the Ono et al. link, Theorem 5.
a(n) gives the sum of cubes of divisors d of n such that n/d is odd. This is called sigma^#_3(n) in the Ono et al. link. See a formula below. - Wolfdieter Lang, Jan 12 2017
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, see p. 139, Ex (ii).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
FORMULA
G.f.: q * Product_{k>=1} (1-q^k)^8 * (1+q^k)^16. - corrected by Vaclav Kotesovec, Oct 14 2015
a(n) = Sum_{0<d|n, n/d odd} d^3. [Glaisher]
Expansion of Jacobi theta constant theta_2(q)^8 / 256 in powers of q.
Expansion of eta(q^2)^16 / eta(q)^8 in powers of q. - Michael Somos, May 31 2005
Expansion of x * psi(x)^8 in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Jan 15 2012
Expansion of (Q(x) - Q(x^2)) / 240 in powers of x where Q() is a Ramanujan Lambert series. - Michael Somos, Jan 15 2012
Expansion of E_{gamma,2}^2 * E_{0,4} in powers of q.
Euler transform of period 2 sequence [8, -8, ...]. - Michael Somos, May 31 2005
G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = v^3 - u^2*w + 16*u*v*w - 32*v^2*w + 256*v*w^2. - Michael Somos, May 31 2005
G.f. is a period 1 Fourier series which satisfies f(-1 / (2 t)) = 16^(-1) (t / i)^4 g(t) where q = exp(2 Pi i t) and g() is the g.f. for A035016. - Michael Somos, Jan 11 2009
Multiplicative with a(2^e) = 2^(3e), a(p^e) = (p^(3(e+1))-1)/(p^3-1). - Mitch Harris, Jun 13 2005
Sum_{k=1..n} a(k) ~ c * n^4, where c = Pi^4/384 = 0.253669... ( A222072). - Amiram Eldar, Oct 19 2022
EXAMPLE
G.f. = q + 8*q^2 + 28*q^3 + 64*q^4 + 126*q^5 + 224*q^6 + 344*q^7 + 512*q^8 + ...
MAPLE
nmax:=40: seq(coeff(series(x*(product((1-x^k)^8*(1+x^k)^16, k=1..nmax)), x, n+1), x, n), n=0..nmax); # Vaclav Kotesovec, Oct 14 2015
MATHEMATICA
Prepend[Table[Plus @@ (Select[Divisors[k + 1], OddQ[(k + 1)/#] &]^3), {k, 0, 39}], 0] (* Ant King, Dec 04 2010 *)
a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)]^8 / 256, {q, 0, n}]; (* Michael Somos, Jun 04 2013 *)
a[ n_] := If[ n < 1, 0, Sum[ d^3 Boole[ OddQ[ n/d]], {d, Divisors[ n]}]]; (* Michael Somos, Jun 04 2013 *)
f[n_] := Total[(2n/Select[ Divisors[ 2n], Mod[#, 4] == 2 &])^3]; Flatten[{0, Array[f, 40] }] (* Robert G. Wilson v, Mar 26 2015 *)
nmax=60; CoefficientList[Series[x*Product[(1-x^k)^8 * (1+x^k)^16, {k, 1, nmax}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Oct 14 2015 *)
QP = QPochhammer; s = q * (QP[-1, q]/2)^16 * QP[q]^8 + O[q]^50; CoefficientList[s, q] (* Jean-François Alcover, Dec 01 2015, adapted from PARI *)
PROG
(PARI) {a(n) = if( n<1, 0, sumdiv( n, d, (n/d%2) * d^3))}; /* Michael Somos, May 31 2005 */
(PARI) {a(n) = local(A); if( n<1, 0, n--; A = x * O(x^n); polcoeff( (eta(x^2 + A)^2 / eta(x + A))^8, n))}; /* Michael Somos, May 31 2005 */
(Sage) ModularForms( Gamma0(2), 4, prec=33).1; # Michael Somos, Jun 04 2013
(Magma) Basis( ModularForms( Gamma0(2), 4), 10) [2]; /* Michael Somos, May 27 2014 */
(Python)
from sympy import divisors
def a(n):
return 0 if n == 0 else sum(((n//d)%2)*d**3 for d in divisors(n))
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809, A076577.
EXTENSIONS
Additional comments from Barry Brent (barryb(AT)primenet.com)
Expansion of Jacobi theta constant theta_2^5 /32.
+10
20
1, 5, 10, 15, 25, 31, 35, 55, 60, 60, 90, 90, 95, 135, 125, 126, 170, 180, 175, 215, 220, 195, 285, 280, 245, 340, 300, 320, 405, 350, 351, 450, 465, 415, 515, 480, 425, 620, 590, 505, 655, 625, 590, 755, 660, 650, 805, 770, 755, 855, 841, 730, 1045, 960, 770, 1100
COMMENTS
Also number of ways of writing n as a sum of five triangular numbers. - N. J. A. Sloane, Jun 01 2013
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
MATHEMATICA
a002129[n_]:=-Sum[(-1)^d*d, {d, Divisors[n]}]; a[n_]:=a[n]=If[n==0, 1, 5 Sum[a002129[k] a[n - k], {k, n}]/n]; Table[a[n], {n, 0, 100}] (* Indranil Ghosh, Aug 02 2017 *)
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Expansion of Jacobi theta constant theta_2^6 /(64q^(3/2)).
+10
19
1, 6, 15, 26, 45, 66, 82, 120, 156, 170, 231, 276, 290, 390, 435, 438, 561, 630, 651, 780, 861, 842, 1020, 1170, 1095, 1326, 1431, 1370, 1716, 1740, 1682, 2016, 2145, 2132, 2415, 2550, 2353, 2850, 3120, 2810, 3321, 3486, 3285, 3906, 4005, 3722, 4350
COMMENTS
Number of representations of n as sum of 6 triangular numbers. - Michel Marcus, Oct 24 2012. See the Ono et al. link.
REFERENCES
B. C. Berndt, Fragments by Ramanujan on Lambert series, in Number Theory and Its Applications, K. Gyory and S. Kanemitsu, eds., Kluwer, Dordrecht, 1999, pp. 35-49, see Entry 6.
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102.
FORMULA
Expansion of Ramanujan phi^6(q) in powers of q.
Expansion of q^(-3/4)(eta(q^2)^2/eta(q))^6 in powers of q.
Euler transform of period 2 sequence [6, -6, ...]. - Michael Somos, May 23 2006
G.f.: (Sum_{n>=0} x^((n^2+n)/2))^6.
a(n) = (-1/8)*Sum_{d divides (4n+3)} Chi_2(4;d)*d^2. - Michel Marcus, Oct 24 2012. See the Ono et al. link. Theorem 4.
EXAMPLE
G.f. = 1 + 6*x + 15*x^2 + 26*x^3 + 45*x^4 + 66*x^5 + 82*x^6 + ... - Michael Somos, Jun 25 2019
G.f. = q^3 + 6*q^7 + 15*q^11 + 26*q^15 + 45*q^19 + 66*q^23 + 82*q^27 + ...
MATHEMATICA
CoefficientList[(QPochhammer[q^2]^2 / QPochhammer[q])^6 + O[q]^50, q] (* Jean-François Alcover, Nov 05 2015 *)
a[ n_] := If[ n < 0, 0, -DivisorSum[ 4 n + 3, Re[I^(# - 1)] #^2 &] / 8]; (* Michael Somos, Jun 25 2019 *)
PROG
(PARI) {a(n) = if( n<0, 0, polcoeff( sum(k=0, (sqrtint(8*n+1)-1)\2, x^((k^2+k)/2), x * O(x^n))^6, n))}; /* Michael Somos, May 23 2006 */
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^2 / eta(x + A))^6, n))}; /* Michael Somos, May 23 2006 */
(PARI) {a(n)= -sumdiv(4*n + 3, d, real(I^(d-1))*d^2)/8}; /* Michael Somos, Oct 24 2012 */
CROSSREFS
Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809, A002173.
a(n) = 12*H(n) where H() is the Hurwitz class number.
+10
19
-1, 0, 0, 4, 6, 0, 0, 12, 12, 0, 0, 12, 16, 0, 0, 24, 18, 0, 0, 12, 24, 0, 0, 36, 24, 0, 0, 16, 24, 0, 0, 36, 36, 0, 0, 24, 30, 0, 0, 48, 24, 0, 0, 12, 48, 0, 0, 60, 40, 0, 0, 24, 24, 0, 0, 48, 48, 0, 0, 36, 48, 0, 0, 60, 42, 0, 0, 12, 48, 0, 0, 84, 36, 0, 0
COMMENTS
Coefficients of q-expansion of Eisenstein series G_{3/2}(tau) multiplied by 12. - N. J. A. Sloane, Mar 16 2019
FORMULA
G.f.: -2 * (Sum_{k in Z} (-1)^k * x^(k*k + k) / (1 + (-x)^k)^2) / (Sum_{k in Z} x^k^2) - 2 * (Sum_{k in Z} (-1)^k * x^(k^2 + 2*k) / (1 + x^(2*k))^2) / (Sum_{k in Z} (-x)^k^2).
EXAMPLE
G.f. = -1 + 4*x^3 + 6*x^4 + 12*x^7 + 12*x^8 + 12*x^11 + 16*x^12 + 24*x^15 + ...
MATHEMATICA
terms = 100; gf[m_] := With[{r = Range[-m, m]}, -2 Sum[(-1)^k*x^(k^2 + k)/(1 + (-x)^k)^2, {k, r}]/EllipticTheta[3, 0, x] - 2 Sum[(-1)^k*x^(k^2 + 2 k)/(1 + x^(2 k))^2, {k, r}]/EllipticTheta[3, 0, -x]]; gf[terms // Sqrt // Ceiling] + O[x]^terms // CoefficientList[#, x]& (* Jean-François Alcover, Apr 02 2017 *)
a[ n_] := If[ n<1, -Boole[n==0], With[{m = Floor[(-1 + Sqrt[1 + 4*n])/2]}, -2*SeriesCoefficient[ Sum[(-1)^k*x^(k^2 + k)/(1 + (-x)^k)^2, {k, -m-1, m}] / EllipticTheta[3, 0, x] + Sum[(-1)^k*x^(k^2 + 2*k)/(1 + x^(2*k))^2, {k, -m-2, m}]/ EllipticTheta[3, 0, -x], {x, 0, n}]]]; (* Michael Somos, Feb 04 2022 *)
PROG
(PARI) {a(n) = 12 * qfbhclassno(n)};
(PARI) {a(n) = my(D, f); 12 * if( n<1, (n==0)/-12, [D, f] = core(-n, 1); if( D%4>1 && !(f%2), D*=4; f/=2); if( D%4<2, qfbclassno(D) / max(1, D+6), 0) * sumdiv(f, d, moebius(d) * kronecker(D, d) * sigma(f/d)))};
Number of ways of writing n as an unordered sum of at most 3 nonzero triangular numbers.
(Formerly M0076 N0027)
+10
18
1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 3, 2, 1, 2, 3, 2, 2, 2, 1, 4, 3, 2, 2, 2, 2, 3, 3, 1, 4, 4, 2, 2, 3, 2, 3, 4, 2, 3, 3, 2, 4, 3, 2, 4, 4, 2, 4, 4, 1, 4, 5, 1, 2, 3, 4, 6, 4, 3, 2, 5, 2, 3, 3, 3, 6, 5, 2, 2, 5, 3, 5, 4, 2, 4, 5, 3, 4, 5, 2, 4, 6, 2, 6, 3, 3, 6, 3, 2, 3, 7, 3, 6, 6, 2, 4, 6, 3, 2
COMMENTS
Fermat asserted that every number is the sum of three triangular numbers. This was proved by Gauss, who recorded in his Tagebuch entry for Jul 10 1796 that: EYPHKA! num = DELTA + DELTA + DELTA.
Equivalently, number of ways of writing n as an unordered sum of exactly 3 triangular numbers. - Jon E. Schoenfield, Mar 28 2021
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 102, eq. (8).
D. H. Lehmer, Review of Loria article, Math. Comp. 2 (1947), 301-302.
G. Loria, Sulla scomposizione di un intero nella somma di numeri poligonali. (Italian) Atti Accad. Naz. Lincei. Rend. Cl. Sci. Fis. Mat. Nat. (8) 1, (1946). 7-15.
Mel Nathanson, Additive Number Theory: The Classical Bases, Graduate Texts in Mathematics, Volume 165, Springer-Verlag, 1996. See Chapter 1.
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).
EXAMPLE
0 : empty sum
1 : 1
2 : 1+1
3 : 3 = 1+1+1
4 : 3+1
5 : 3+1+1
6 : 6 = 3+3
7 : 6+1 = 3+3+1
...
13 : 10 + 3 = 6 + 6 + 1, so a(13) = 2.
MATHEMATICA
a = Table[ n(n + 1)/2, {n, 0, 15} ]; b = {0}; c = Table[ 0, {100} ]; Do[ b = Append[ b, a[ [ i ] ] + a[ [ j ] ] + a[ [ k ] ] ], {k, 1, 15}, {j, 1, k}, {i, 1, j} ]; b = Delete[ b, 1 ]; b = Sort[ b ]; l = Length[ b ]; Do[ If[ b[ [ n ] ] < 100, c[ [ b[ [ n ] ] + 1 ] ]++ ], {n, 1, l} ]; c
PROG
(PARI) first(n)=my(v=vector(n+1), A, B, C); for(a=0, n, A=a*(a+1)/2; if(A>n, break); for(b=0, a, B=A+b*(b+1)/2; if(B>n, break); for(c=0, b, C=B+c*(c+1)/2; if(C>n, break); v[C+1]++))); v \\ Charles R Greathouse IV, Jun 23 2017
Search completed in 0.036 seconds
|