cp's OEIS Frontend

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

Showing 1-3 of 3 results.

A025428 Number of partitions of n into 4 nonzero squares.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 3, 0, 1, 2, 0, 1, 2, 1, 2, 2, 1, 2, 1, 0, 3, 2, 1, 2, 1, 2, 1, 2, 2, 1, 4, 1, 2, 3, 0, 2, 4, 1, 3, 2, 1, 4, 1, 1, 3, 3, 2, 2, 4, 2, 1, 3, 2, 3, 4, 2, 3, 3, 1, 2, 5, 2, 4, 3, 2, 4, 1, 1, 6, 4, 3, 4, 2, 3, 0, 4, 4, 3, 5, 1, 5, 5, 1, 4, 5, 2
Offset: 0

Views

Author

Keywords

Comments

Records occur at n= 4, 28, 52, 82, 90, 130, 162, 198, 202, 210,.... - R. J. Mathar, Sep 15 2015

Crossrefs

Cf. A000414, A000534, A025357-A025375, A216374, A025416 (greedy inverse).
Column k=4 of A243148.

Programs

  • Maple
    A025428 := proc(n)
        local a,i,j,k,lsq ;
        a := 0 ;
        for i from 1 do
            if 4*i^2 > n then
                return a;
            end if;
            for j from i do
                if i^2+3*j^2 > n then
                    break;
                end if;
                for k from j do
                    if i^2+j^2+2*k^2 > n then
                        break;
                    end if;
                    lsq := n-i^2-j^2-k^2 ;
                    if lsq >= k^2 and issqr(lsq) then
                        a := a+1 ;
                    end if;
                end do:
            end do:
        end do:
    end proc:
    seq(A025428(n),n=1..40) ; # R. J. Mathar, Jun 15 2018
    # second Maple program:
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
         `if`(i<1 or t<1, 0, b(n, i-1, t)+`if`(i^2>n, 0, b(n-i^2, i, t-1))))
        end:
    a:= n-> b(n, isqrt(n), 4):
    seq(a(n), n=0..100);  # Alois P. Heinz, Apr 14 2019
  • Mathematica
    nn = 100; lim = Sqrt[nn]; t = Table[0, {nn}]; Do[n = a^2 + b^2 + c^2 + d^2; If[n <= nn, t[[n]]++], {a, lim}, {b, a, lim}, {c, b, lim}, {d, c, lim}]; t (* T. D. Noe, Sep 28 2012 *)
    f[n_] := Length@ IntegerPartitions[n, {4}, Range[ Floor[ Sqrt[n - 1]]]^2]; Array[f, 105] (* Robert G. Wilson v, Sep 28 2012 *)
  • PARI
    A025428(n)=sum(a=1,n,sum(b=1,a,sum(c=1,b,sum(d=1,c,a^2+b^2+c^2+d^2==n))))
    
  • PARI
    A025428(n)=sum(a=1,sqrtint(max(n-3,0)), sum(b=1,min(sqrtint(n-a^2-2),a), sum(c=1,min(sqrtint(n-a^2-b^2-1),b),issquare(n-a^2-b^2-c^2,&d) & d <= c )))
    
  • PARI
    A025428(n)=sum(a=sqrtint(max(n,4)\4),sqrtint(max(n-3,0)), sum(b=sqrtint((n-a^2)\3-1)+1,min(sqrtint(n-a^2-2),a), sum(c=sqrtint((t=n-a^2-b^2)\2-1)+1, min(sqrtint(t-1),b), issquare(t-c^2) ))) \\ - M. F. Hasler, Sep 17 2012
    for(n=1,100,print1(A025428(n),","))
    
  • PARI
    T(n)={a=matrix(n,4,i,j,0);for(d=1,sqrtint(n),forstep(i=n,d*d+1,-1,for(j=2,4,a[i,j]+=sum(k=1,j,if(k0,a[i-k*d*d,j-k],if(k==j&&i-k*d*d==0,1)))));a[d*d,1]=1);for(i=1,n,print(i" "a[i,4]))} /* Robert Gerbicz, Sep 28 2012 */

Formula

For n>0, a(n) = ( A063730(n) + 6*A213024(n) + 3*A063725(n/2) + 8*A092573(n) + 6*A010052(n/4) ) / 24. - Max Alekseyev, Sep 30 2012
a(n) = ( A000118(n) - 4*A005875(n) - 6*A004018(n) - 12*A000122(n) - 15*A000007(n) + 12*A014455(n) - 24*A033715(n) - 12*A000122(n/2) + 12*A004018(n/2) + 32*A033716(n) - 32*A000122(n/3) + 48*A000122(n/4) ) / 384. - Max Alekseyev, Sep 30 2012
a(n) = [x^n y^4] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
a(n) = Sum_{k=1..floor(n/4)} Sum_{j=k..floor((n-k)/3)} Sum_{i=j..floor((n-j-k)/2)} A010052(i) * A010052(j) * A010052(k) * A010052(n-i-j-k). - Wesley Ivan Hurt, Apr 19 2019

Extensions

Values of a(0..10^4) double-checked by M. F. Hasler, Sep 17 2012

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

Views

Author

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

Crossrefs

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.

A156384 The number of solutions to x^2 + y^2 + 2*z^2 = n in nonnegative integers x,y,z.

Original entry on oeis.org

1, 2, 2, 2, 3, 2, 2, 2, 2, 4, 4, 2, 4, 4, 0, 2, 3, 4, 6, 4, 4, 2, 4, 2, 2, 6, 4, 6, 6, 2, 0, 4, 2, 6, 8, 2, 7, 6, 4, 2, 4, 4, 6, 6, 4, 6, 0, 4, 4, 6, 6, 4, 10, 4, 6, 6, 0, 6, 10, 4, 6, 6, 0, 6, 3, 4, 8, 8, 8, 4, 6, 2, 6, 10, 4, 6, 10, 4, 0, 4, 4, 8, 14, 6, 6, 8, 4, 6, 4, 6, 10, 6, 6, 6, 0, 2, 2, 12, 8, 8
Offset: 0

Views

Author

R. H. Hardin Feb 09 2009

Keywords

Comments

Also, the number of 4X4 matrices composed of squares of integers, symmetric under 90 degree rotation, with all rows summing to n. Such matrices have the form:
z^2 x^2 y^2 z^2
y^2 z^2 z^2 x^2
x^2 z^2 z^2 y^2
z^2 y^2 x^2 z^2
with x^2 + y^2 + 2*z^2 = n.

Examples

			All matrices for n=9:
...0.0.9.0...0.9.0.0...4.0.1.4...4.1.0.4
...9.0.0.0...0.0.0.9...1.4.4.0...0.4.4.1
...0.0.0.9...9.0.0.0...0.4.4.1...1.4.4.0
...0.9.0.0...0.0.9.0...4.1.0.4...4.0.1.4
		

Crossrefs

Formula

a(n) = ( A014455(n) + 2*A033715(n) + A004018(n) + A000122(n/2) + 2*A000122(n) + A000007(n) )/8. - Max Alekseyev, Sep 29 2012
G.f.: (1 + theta_3(q))^2*(1 + theta_3(q^2))/8, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 01 2018

Extensions

More general definition from Max Alekseyev, Sep 29 2012
Showing 1-3 of 3 results.