cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: {n>=1} = (5, 15, 170, 4935, ...) is realizable in the sense that there is a self-map on a set T:X->X with the property that a(n) = #{x in X:T^nx=x} for all n >= 1. This is the simplest illustrative example of two different phenomena. The Fibonacci sequence sampled along an odd power cannot be made realizable after multiplication by a constant; the Fibonacci sequence sampled along an even power becomes realizable after multiplication by 5 (the discriminant of the sequence). This is now known to be an instance of a more general phenomenon in the following sense. If (a(n)) is a linear recurrence sequence whose characteristic polynomial F has simple zeros then the sequence (Ma(n^s)) satisfies the Dold congruence, where M=|discriminant(F)| and s is an integer multiple of the exponent of the Galois group of the splitting field of F over the rationals. Under an additional hypothesis on the signs of the coefficients of F, the sequence (Ma(n^s)) is realizable. - _Thomas Ward

{n>=1} = (5, 15, 170, 4935, ...) is realizable in the sense that there is a self-map on a set T:X->X with the property that a(n) = #{x in X:T^nx=x} for all n >= 1. This is the simplest illustrative example of two different phenomena. The Fibonacci sequence sampled along an odd power cannot be made realizable after multiplication by a constant; the Fibonacci sequence sampled along an even power becomes realizable after multiplication by 5 (the discriminant of the sequence). This is now known to be an instance of a more general phenomenon in the following sense. If (a(n)) is a linear recurrence sequence whose characteristic polynomial F has simple zeros then the sequence (Ma(n^s)) satisfies the Dold congruence, where M=|discriminant(F)| and s is an integer multiple of the exponent of the Galois group of the splitting field of F over the rationals. Under an additional hypothesis on the signs of the coefficients of F, the sequence (Ma(n^s)) is realizable. - _Thomas Ward's wiki page.

{n>=1} = (5, 15, 170, 4935, ...) is realizable in the sense that there is a self-map on a set T:X->X with the property that a(n) = #{x in X:T^nx=x} for all n >= 1. This is the simplest illustrative example of two different phenomena. The Fibonacci sequence sampled along an odd power cannot be made realizable after multiplication by a constant; the Fibonacci sequence sampled along an even power becomes realizable after multiplication by 5 (the discriminant of the sequence). This is now known to be an instance of a more general phenomenon in the following sense. If (a(n)) is a linear recurrence sequence whose characteristic polynomial F has simple zeros then the sequence (Ma(n^s)) satisfies the Dold congruence, where M=|discriminant(F)| and s is an integer multiple of the exponent of the Galois group of the splitting field of F over the rationals. Under an additional hypothesis on the signs of the coefficients of F, the sequence (Ma(n^s)) is realizable. - _Thomas Ward has authored 5 sequences.

A318184 a(n) = 2^(n * (n - 1)/2) * 3^((n - 1) * (n - 2)) * n^(n - 3).

Original entry on oeis.org

1, 1, 72, 186624, 13604889600, 24679069470425088, 1036715783690392172494848, 962459606796748852884396910313472, 19112837387997044228759204010262201783812096, 7926475921550134182551017087135940323782552453120000000, 67406870957147550175650545441605700298239194363455522532832462241792
Offset: 1

Author

Rigoberto Florez, Aug 20 2018

Keywords

Comments

Discriminant of Fermat polynomials.
F(0)=0, F(1)=1 and F(n) = 3x F(n - 1) -2 F(n - 2) if n>1.

Crossrefs

Programs

  • Maple
    seq(2^(n*(n-1)/2)*3^((n-1)*(n-2))*n^(n-3),n=1..12); # Muniru A Asiru, Dec 07 2018
  • Mathematica
    F[0] = 0; F[1] = 1; F[n_] := F[n] = 3 x F[n - 1] - 2 F[n - 2];
    a[n_] := Discriminant[F[n], x];
    Array[a, 11] (* Jean-François Alcover, Dec 07 2018 *)
  • PARI
    a(n) = 2^(n*(n-1)/2) * 3^((n-1)*(n-2)) * n^(n-3); \\ Michel Marcus, Dec 07 2018

A054783 (n^2)-th Fibonacci number.

Original entry on oeis.org

0, 1, 3, 34, 987, 75025, 14930352, 7778742049, 10610209857723, 37889062373143906, 354224848179261915075, 8670007398507948658051921, 555565404224292694404015791808, 93202207781383214849429075266681969, 40934782466626840596168752972961528246147
Offset: 0

Author

Jeff Burch, May 22 2000

Keywords

Crossrefs

Cf. (n^k)-th Fibonacci number: A000045 (k=1), this sequence (k=2), A182149 (k=3), A250490 (k=4), A250491 (k=5), A250492 (k=6), A250493 (k=7), A250494 (k=8).
Cf. A081667.
Cf. A341617 shows a similar property for the Stirling numbers of the second kind.

Programs

Formula

a(n) = Sum_{k=1..T(n-1)+1} binomial(T(n-1), k-1)*F(n-1+k), where F(n) is A000045 and T(n) is A000217. - Tony Foster III, Sep 03 2018

A014455 Theta series of quadratic form with Gram matrix [ 1, 0, 0; 0, 1, 0; 0, 0, 2 ]. Number of integer solutions to x^2 + y^2 + 2*z^2 = n.

Original entry on oeis.org

1, 4, 6, 8, 12, 8, 8, 16, 6, 12, 24, 8, 24, 24, 0, 16, 12, 16, 30, 24, 24, 16, 24, 16, 8, 28, 24, 32, 48, 8, 0, 32, 6, 32, 48, 16, 36, 40, 24, 16, 24, 16, 48, 40, 24, 40, 0, 32, 24, 36, 30, 16, 72, 24, 32, 48, 0, 32, 72, 24, 48, 40, 0, 48, 12, 16, 48, 56, 48, 32, 48, 16, 30, 64
Offset: 0

Keywords

Comments

This is the tetragonal P lattice (the classical holotype) of dimension 3.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = 1 + 4*q + 6*q^2 + 8*q^3 + 12*q^4 + 8*q^5 + 8*q^6 + 16*q^7 + 6*q^8 + 12*q^9 + ...
		

Programs

  • Magma
    A := Basis( ModularForms( Gamma1(8), 3/2), 40); A[1] + 4*A[2] + 6*A[3] + 8*A[4]; /* Michael Somos, Aug 31 2014 */
  • Mathematica
    r[n_, z_] := Reduce[x^2 + y^2 + 2*z^2 == n, {x, y}, Integers]; a[n_] := Module[{rn0, rnz, k0, k}, rn0 = r[n, 0]; k0 = If[rn0 === False, 0, If[Head[rn0] === And, 1, Length[rn0]]]; For[k = 0; z = 1, z <= Ceiling[Sqrt[n/2]], z++, rnz = r[n, z]; If[rnz =!= False, k = If[Head[rnz] === And, k+1, k + Length[rnz]]]]; k0 + 2*k]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Oct 07 2013 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^2 EllipticTheta[ 3, 0, q^2], {q, 0, n}]; (* Michael Somos, Aug 31 2014 *)
    QP = QPochhammer; s = QP[q^2]^8*(QP[q^4]/(QP[q]^4*QP[q^8]^2)) + O[q]^80; CoefficientList[s, q] (* Jean-François Alcover, Nov 25 2015, after Michael Somos *)
  • PARI
    {a(n) = if( n<1, n==0, 2 * qfrep([ 1, 0, 0; 0, 1, 0; 0, 0, 2], n)[n])}; /* Michael Somos, Jul 05 2005 */
    
  • PARI
    {a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^8 * eta(x^4 + A) / (eta(x + A)^4 * eta(x^8 + A)^2), n))}; /* Michael Somos, Jul 05 2005 */
    

Formula

Expansion of phi(q)^2 * phi(q^2) = psi(q)^4 / psi(q^4) in powers of q where phi(), psi() are Ramanujan theta functions. - Michael Somos, Apr 07 2012
Expansion of eta(q^2)^8 * eta(q^4) / (eta(q)^4 * eta(q^8)^2) in powers of q. - Michael Somos, Jul 05 2005
Euler transform of period 8 sequence [4, -4, 4, -5, 4, -4, 4, -3, ...]. - Michael Somos, Jul 07 2005
G.f.: theta_3(q)^2 * theta_3(q^2) = Product_{k>0} (1 - x^(2*k))^8 * (1 - x^(4*k)) / ((1 - x^k)^4 * (1 - x^(8*k))^2).
There is a classical formula (essentially due to Gauss): Write (uniquely) -2n=D(2^vf)^2, with D<0 fundamental discriminant, f odd, v>=-1. Then a(n)=12L((D/.),0)(1-(D/2))\sum_{d\mid f}\mu(d)(D/d)sigma(f/d) (the formula for A005875), except that the factor (1-(D/2)) has to be replaced by 1/3 if v=-1 and by 1 if v=0 (and kept if v>=1). 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(2*n) = a(8*n) = A005875(n). a(2*n + 1) = A005877(n) = 4 * A045828(n). a(4*n) = A004015(n). a(4*n + 2) = 2 * A045826(n). a(8*n + 4) = 12 * A045828(n). a(8*n + 7) = 16 * A033763(n). a(16*n + 6) = 8 * A008443(n). a(16*n + 14) = 0. - Michael Somos, Apr 07 2012
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 32^(1/2) (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A246631.

A007878 Number of terms in discriminant of generic polynomial of degree n.

Original entry on oeis.org

1, 2, 5, 16, 59, 246, 1103, 5247, 26059, 133881, 706799, 3815311, 20979619, 117178725, 663316190, 3798697446, 21976689397
Offset: 1

Author

reiner(AT)math.umn.edu

Keywords

Comments

Here "generic" means that the coefficients are algebraically independent symbols. - Robert Israel, Oct 02 2015
At one point it was suggested that this is the same sequence as A039744, but this is wrong. Dean Hickerson, Dec 16 2006, comments as follows: (Start)
The claim that A039744 equals the number of monomials in the discriminant is false. The first counterexample is n=4: There are 18 such partitions, but the discriminant has no terms corresponding to the partitions 3+2+2+2+2+1 and 2+2+2+2+2+2, so the number of monomials in the discriminant is only 16.
Columns near the left or right have very few nonzero elements and this adds some restrictions to the partitions.
For example, from column 2 of the matrix, we see that the partition must have at least one term equal to n or n-1. From the last column, it must have at least one term equal to 0 or 1. Maybe the complete list of such conditions is enough; I don't know.
Even if we could figure out exactly which partitions correspond to monomials that occur in the expansion, I can't rule out the possibility that the coefficients of some such monomial could cancel out, further reducing the number of nonzero monomials in the discriminant. (End)

Examples

			Discriminant of a_0 + a_1 x + ... + a_n x^n is 1/a_n times the determinant of a particular matrix; for n=4 that matrix is
  [ a_4   a_3   a_2   a_1   a_0   0     0    ]
  [ 0     a_4   a_3   a_2   a_1   a_0   0    ]
  [ 0     0     a_4   a_3   a_2   a_1   a_0  ]
  [ 4a_4  3a_3  2a_2  1a_1  0     0     0    ]
  [ 0     4a_4  3a_3  2a_2  1a_1  0     0    ]
  [ 0     0     4a_4  3a_3  2a_2  1a_1  0    ]
  [ 0     0     0     4a_4  3a_3  2a_2  1a_1 ]
It is easy to see that there are no monomials in the expansion of this involving either a_4 * a_3 * a_2^4 * a_1 or a_4 * a_2^6.
The discriminant of the cubic K3*x^3 + K2*x^2 + K1*x + K0 is -27*K3^2*K0^2 + 18*K3*K2*K1*K0 - 4*K2^3*K0 - 4*K3*K1^3 + K2^2*K1^2 which contains 5 monomials. - Bill Daly (bill.daly(AT)tradition.co.uk)
		

Programs

  • Magma
    function Disc(n) F := FunctionField(Rationals(),n); R := PolynomialRing(F); f := x^n + &+[ (F.i)*x^(n-i) : i in [ 1..n ] ]; return Discriminant(f); end function; [ #Monomials(Numerator(Disc(n))) : n in [ 1..7 ] ] // Victor S. Miller, Dec 16 2006
    
  • Maple
    A007878 := proc(n) local x,a,ii; nops(discrim(sum(a[ ii ]*x^ii, ii=0..n), x)) end;
  • Mathematica
    Clear[f, g]; g[0] = f[0]; g[n_Integer?Positive] := g[n] = g[n - 1] + f[n] x^n; myFun[n_Integer?Positive] := Length@Resultant[g[n], D[g[n], x], x, Method -> "BezoutMatrix"]; Table[myFun[n], {n, 1, 8}] (* Artur Jasinski, improved by Jean-Marc Gulliet (jeanmarc.gulliet(AT)gmail.com) *)
  • Sage
    A = InfinitePolynomialRing(QQ, 'a')
    a = A.gen()
    for N in range(1, 7):
        x = polygen(A, 'x')
        P = sum(a[i] * x^i for i in range(N + 1))
        M = P.sylvester_matrix(diff(P, x), x)
        print(M.determinant().number_of_terms())
    # Georg Muntingh, Jan 17 2014

Extensions

a(9) from Lyle Ramshaw (ramshaw(AT)pa.dec.com)
Entry revised by N. J. A. Sloane, Dec 16 2006
a(10) from Artur Jasinski, Apr 02 2008
a(11) from Georg Muntingh, Jan 17 2014
a(12) from Georg Muntingh, Mar 10 2014
a(13)-a(14) from Seiichi Manyama, Nov 08 2023
a(15)-a(17) from Kimura (2013) added by Andrey Zabolotskiy, Jun 30 2024

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

Original entry on oeis.org

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
Offset: 0

Keywords

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

Examples

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

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

Crossrefs

Row d=3 of A122141 and of A319574, 3rd column of A286815.
Cf. A074590 (primitive solutions), A117609 (partial sums), A004215 (positions of zeros).
Analog for 4 squares: A000118.
x^2+y^2+k*z^2: A005875, A014455, A034933, A169783, A169784.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A005875List(len) = JacobiTheta3(len, 3)
    A005875List(75) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 3/2), 75) [1]; /* Michael Somos, Jun 25 2014 */
    
  • 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
    SquaresR[3,Range[0,80]] (* Harvey P. Dale, Jul 21 2011 *)
    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 *)
  • 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 */
    
  • Python
    # uses Python code for A004018
    from math import isqrt
    def A005875(n): return A004018(n)+(sum(A004018(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 21 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*3)
    Q.representation_number_list(75) # Peter Luschny, Jun 20 2014
    

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).
a(n) = A004015(2*n) = A014455(2*n) = A004013(4*n) = A169783(4*n). a(4*n + 1) = 6 * A045834(n). a(8*n + 3) = 8 * A008443(n). a(8*n + 5) = 24 * A045831(n). - Michael Somos, Jun 03 2012
a(4*n + 2) = 12 * A045828(n). - Michael Somos, Sep 03 2014
a(n) = (-1)^n * A213384(n). - Michael Somos, May 21 2015
a(n) = (6/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = A004018(n) + 2*Sum_{k=1..floor(sqrt(n))} A004018(n - k^2). - Daniel Suteu, Aug 27 2021
Convolution cube of A000122. Convolution of A004018 and A000122. - R. J. Mathar, Aug 03 2025

Extensions

More terms from James Sellers, Aug 22 2000