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.

A000378 Sums of three squares: numbers of the form x^2 + y^2 + z^2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition: numbers of the form x^2 + y^2 + z^2 with x,y,z >= 0.
Bourgain studies "the spatial distribution of the representation of a large integer as a sum of three squares, on the small and critical scale as well as their electrostatic energy. The main results announced give strong evidence to the thesis that the solutions behave randomly. This is in sharp contrast to what happens with sums of two or four or more square." Sums of two nonzero squares are A000404. - Jonathan Vos Post, Apr 03 2012
The multiplicities for a(n) (if 0 <= x <= y <= z) are given as A000164(a(n)), n >= 1. Compare with A005875(a(n)) for integer x, y and z, and order taken into account. - Wolfdieter Lang, Apr 08 2013
a(n)^k is a member of this sequence for any k > 1. - Boris Putievskiy, May 05 2013
The selection rule for the planes with Miller indices (hkl) to undergo X-ray diffraction in a simple cubic lattice is h^2+k^2+l^2 = N where N is a term of this sequence. See A004014 for f.c.c. lattice. - Mohammed Yaseen, Nov 06 2022

Examples

			a(1) = 0 = 0^2 + 0^2 + 0^2. A005875(0) = 1 = A000164(0).
a(9) = 9 = 0^2 + 0^2 + 3^2 =  1^2 +  2^2 + 2^2. A000164(9) = 2. A000164(9) = 30 = 2*3 + 8*3 (counting signs and order). - _Wolfdieter Lang_, Apr 08 2013
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 37.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section C20.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 311.

Crossrefs

Union of A000290, A000404 and A000408 (common elements).
Union of A000290, A000415 and A000419 (disjunct sets).
Complement of A004215.
Cf. A005875 (number of representations if x, y and z are integers).

Programs

  • Maple
    isA000378 := proc(n) # return true or false depending on n being in the list
        local x,y ;
        for x from 0 do
            if 3*x^2 > n then
                return false;
            end if;
            for y from x do
                if x^2+2*y^2 > n then
                    break;
                else
                    if issqr(n-x^2-y^2) then
                        return true;
                    end if;
                end if;
            end do:
        end do:
    end proc:
    A000378 := proc(n) # generate A000378(n)
        option remember;
        local a;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA000378(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A000378(n),n=1..100) ; # R. J. Mathar, Sep 09 2015
  • Mathematica
    okQ[n_] := If[EvenQ[k = IntegerExponent[n, 2]], m = n/2^k; Mod[m, 8] != 7, True]; Select[Range[0, 100], okQ] (* Jean-François Alcover, Feb 08 2016, adapted from PARI *)
  • PARI
    isA000378(n)=my(k=valuation(n, 2)); if(k%2==0, n>>=k; n%8!=7, 1)
    
  • PARI
    list(lim)=my(v=List(),k,t); for(x=0,sqrtint(lim\=1), for(y=0, min(sqrtint(lim-x^2),x), k=x^2+y^2; for(z=0,min(sqrtint(lim-k), y), listput(v,k+z^2)))); Set(v) \\ Charles R Greathouse IV, Sep 14 2015
    
  • Python
    def valuation(n, b):
        v = 0
        while n > 1 and n%b == 0: n //= b; v += 1
        return v
    def ok(n): return n//4**valuation(n, 4)%8 != 7
    print(list(filter(ok, range(84)))) # Michael S. Branicky, Jul 15 2021
    
  • Python
    from itertools import count, islice
    def A000378_gen(): # generator of terms
        return filter(lambda n:n>>2*(bin(n)[:1:-1].index('1')//2) & 7 < 7, count(1))
    A000378_list = list(islice(A000378_gen(),30)) # Chai Wah Wu, Jun 27 2022
    
  • Python
    def A000378(n):
        def f(x): return n-1+sum(((x>>(i<<1))-7>>3)+1 for i in range(x.bit_length()>>1))
        m, k = n-1, f(n-1)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 14 2025

Formula

Legendre: a nonnegative integer is a sum of three squares iff it is not of the form 4^k m with m == 7 (mod 8).
n^(2k+1) is in the sequence iff n is in the sequence. - Ray Chandler, Feb 03 2009
Complement of A004215; complement of A000302(i)*A004771(j), i,j>=0. - Boris Putievskiy, May 05 2013
a(n) = 6n/5 + O(log n). - Charles R Greathouse IV, Mar 14 2014

Extensions

More terms from Ray Chandler, Sep 05 2004

A004013 Theta series of body-centered cubic (b.c.c.) lattice.

Original entry on oeis.org

1, 0, 0, 8, 6, 0, 0, 0, 12, 0, 0, 24, 8, 0, 0, 0, 6, 0, 0, 24, 24, 0, 0, 0, 24, 0, 0, 32, 0, 0, 0, 0, 12, 0, 0, 48, 30, 0, 0, 0, 24, 0, 0, 24, 24, 0, 0, 0, 8, 0, 0, 48, 24, 0, 0, 0, 48, 0, 0, 72, 0, 0, 0, 0, 6, 0, 0, 24, 48, 0, 0, 0, 36, 0, 0, 56, 24, 0, 0, 0, 24, 0, 0, 72, 48, 0, 0, 0, 24, 0, 0
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = 1 + 8*x^3 + 6*x^4 + 12*x^8 + 24*x^11 + 8*x^12 + 6*x^16 + 24*x^19 + 24*x^20 + ...
G.f. = 1 + 8*q^(3/2) + 6*q^2 + 12*q^4 + 24*q^(11/2) + 8*q^6 + 6*q^8 + 24*q^(19/2) + 24*q^10 + 24*q^12 + 32*q^(27/2) + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 116.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    Basis( ModularForms( Gamma0(8), 3/2), 90) [1]; /* Michael Somos, Sep 04 2014 */
  • Maple
    M:=100; M1:=M*(M+1)/2; ph:=series(add(q^(k^2),k=-M..M),q,M1): ps:=series(add(q^(k*(k+1)/2),k=0..M),q,M1): t1:=series(subs(q=q^2, ph)^3, q,M1): t2:=series((2*sqrt(q))^3*subs(q=q^4, ps)^3,q,M1): t3:=seriestolist(series(subs(q=q^2,t1+t2),q,M1)): for n from 0 to nops(t3)-1 do lprint(n,t3[n+1]); od:
  • Mathematica
    m = 13; m1 = m*((m + 1)/2); ph[q_] = Series[ Sum[ q^k^2, {k, -m, m}], {q, 0, m1}]; ps[q_] = Series[ Sum[ q^(k*((k + 1)/2)), {k, 0, m}], {q, 0, m1}]; t1[q_] = Normal[ Series[ ph[q^2]^3, {q, 0, m1}]]; t2[q_] = Normal[ Series[ (2*Sqrt[q])^3*ps[q^4]^3, {q, 0, m1}]]; CoefficientList[ Series[ t1[q^2] + t2[q^2], {q, 0, m1}], q] (* Jean-François Alcover, Dec 20 2011, translated from Maple *)
    (* From version 6 on *) terms=91; f[q_] = LatticeData["BodyCenteredCubic", "ThetaSeriesFunction"][-I Log[q]/Pi]; CoefficientList[Simplify[f[q] + O[q]^terms, q>0], q][[1 ;; terms]] (* Jean-François Alcover, May 15 2013, updated Jul 08 2017 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, x^4]^3 + EllipticTheta[ 2, 0, x^4]^3, {x, 0, n}]; (* Michael Somos, May 24 2013 *)
  • PARI
    {a(n) = if( n<0, 0, if( n%4==0, n/=4; polcoeff( sum(k=1, sqrtint(n), 2*x^k^2, 1 + x * O(x^n))^3, n), n%8==3, n\=8; 8*polcoeff( sum(k=0, (sqrtint(8*n+1) - 1)\2, x^((k^2 + k)/2), x * O(x^n))^3, n)))}; /* Michael Somos, Oct 25 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^8 + A)^5 / eta(x^4 + A)^2 / eta(x^16 + A)^2)^3 + (2 * x * eta(x^16 + A)^2 / eta(x^8 + A))^3, n))}; /* Michael Somos, May 17 2008 */
    

Formula

subs(q=q^2, ph)^3+(2*sqrt(q))^3*subs(q=q^4, ps)^3, where ps = A010054 = Sum_{k=0..infinity} q^(k*(k+1)/2), ph = A000122 = Sum_{k=-infinity, infinity} q^(k^2).
Expansion of phi(q^4)^3 + 8 * q^3 * psi(q^8)^3 in powers of q where phi(), psi() are Ramanujan theta functions. - Michael Somos, Oct 25 2006
a(4*n + 1) = a(4*n + 2) = a(8*n + 7) = 0. a(4*n) = A005875(n).
Expansion of theta_3(q)^3 + theta_2(q)^3 in powers of q^(1/4).
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 2 (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A004015.
a(8*n) = A004015(n). a(8*n + 3) = 8 * A008443(n). a(8*n + 4) = 2 * A045826(n). - Michael Somos, Jul 19 2015
a(12*n + 4) = 6 * A213056(n). a(16*n + 4) = 6 * A045834(n). a(16*n + 8) = 12 * A045828(n).

A072835 Exponents occurring in expansion of F_9(q^2).

Original entry on oeis.org

0, 8, 14, 18, 20, 26, 32, 36, 38, 44, 50, 54, 56, 62, 68, 72, 74, 80, 86, 90, 92, 98, 104, 108, 110, 116, 122, 126, 128, 134, 140, 144, 146, 152, 158, 162, 164, 170, 176, 180, 182, 188, 194, 198, 200, 206, 212, 216, 218, 224, 230, 234, 236, 242, 248, 252, 254, 260, 266, 270, 272, 278
Offset: 0

Views

Author

N. J. A. Sloane, Jul 25 2002

Keywords

Comments

Twice (A242660 without 1). Also, norms of vectors of the A*8 lattice. - _Andrey Zabolotskiy, Nov 10 2021

Crossrefs

Programs

  • Mathematica
    f[x_, y_]:= QPochhammer[-x, x*y]*QPochhammer[-y, x*y]*QPochhammer[x*y, x*y];
    F[9,q_]:= f[q^9, q^9]^8 - 16*q^9*f[q^9, q^27]^8 + 256*q^18*f[q^18, q^54]^8 + 18*q^8*QPochhammer[q^18]^12/QPochhammer[q^6]^4;
    cfs = CoefficientList[Series[F[9, q], {q, 0, 500}], q];
    Take[Pick[Range[Length[cfs]] - 1, Sign[Abs[cfs]], 1], 50] (* G. C. Greubel, Apr 16 2018 *)

Formula

G.f.: -2*x*(x^4-x^3-2*x^2-3*x-4) / (x^5-x^4-x+1). - Colin Barker, Jul 31 2013
a(n+4) = a(n) + 18 for n > 0. - Jerzy R Borysowicz, Sep 02 2023
a(n)/n ~ 9/2. - Jerzy R Borysowicz, Sep 03 2023
a(n) = 2 * A056991(n+1) for n>=1. - Alois P. Heinz, Sep 03 2023

Extensions

Terms a(22) onward added by G. C. Greubel, Apr 16 2018
Showing 1-3 of 3 results.