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-8 of 8 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

A034043 Numbers that are imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

0, 4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 32, 36, 40, 44, 45, 48, 49, 50, 52, 54, 56, 64, 68, 72, 75, 76, 80, 81, 84, 88, 90, 96, 98, 99, 100, 104, 108, 116, 117, 120, 121, 125, 126, 128, 132, 136, 140, 144, 147, 148, 150, 152, 153, 160, 162, 164, 168, 169
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034043 and A034044 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and not squarefree. - Ray Chandler, Sep 05 2004

A034045 Numbers that are imprimitively but not primitively represented by x^2+y^2+z^2.

Original entry on oeis.org

0, 4, 8, 12, 16, 20, 24, 32, 36, 40, 44, 48, 52, 56, 64, 68, 72, 76, 80, 84, 88, 96, 100, 104, 108, 116, 120, 128, 132, 136, 140, 144, 148, 152, 160, 164, 168, 172, 176, 180, 184, 192, 196, 200, 204, 208, 212, 216, 224, 228, 232, 236, 244, 248, 256
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A047449 and A034045 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

A034047 Numbers that are primitively or imprimitively represented by x^2+y^2+z^2, but not both.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 26, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 46, 48, 51, 52, 53, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 80, 82, 83, 84, 85, 86, 88, 89, 91, 93
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034046 and A034047 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and either squarefree or congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

A034044 Numbers that are primitively but not imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 11, 13, 14, 17, 19, 21, 22, 26, 29, 30, 33, 34, 35, 37, 38, 41, 42, 43, 46, 51, 53, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 73, 74, 77, 78, 82, 83, 85, 86, 89, 91, 93, 94, 97, 101, 102, 105, 106, 107, 109, 110, 113, 114, 115, 118, 122, 123
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034043 and A034044 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and squarefree. - Ray Chandler, Sep 05 2004

A034046 Numbers that are both primitively and imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

9, 18, 25, 27, 45, 49, 50, 54, 75, 81, 90, 98, 99, 117, 121, 125, 126, 147, 150, 153, 162, 169, 171, 189, 198, 225, 234, 242, 243, 245, 250, 261, 270, 275, 289, 294, 297, 306, 315, 325, 333, 338, 342, 350, 361, 363, 369, 378, 387, 405, 414, 425
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034046 and A034047 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and neither squarefree nor congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

A224448 Nonnegative numbers that have a representation as a sum of three primitive and distinct squares (square 0 allowed).

Original entry on oeis.org

5, 10, 13, 14, 17, 21, 25, 26, 29, 30, 34, 35, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 58, 59, 61, 62, 65, 66, 69, 70, 73, 74, 75, 77, 78, 81, 82, 83, 85, 86, 89, 90, 91, 93, 94, 97, 98, 101, 105, 106, 107, 109, 110, 113, 114, 115, 117, 118, 121, 122, 125, 126, 129, 130
Offset: 1

Views

Author

Wolfdieter Lang, Apr 09 2013

Keywords

Comments

These are the numbers a(n) satisfying A224447(a(n)) = k >= 1, and k gives their multiplicity. See the comments on A224447 for more details and a F. Halter-Koch corollary (Korollar 1. (c), p. 13 with the first line of r_3(n) on p. 11) according to which this sequence gives the increasingly ordered numbers satisfying: neither congruent 0, 4, 7 (mod 8) nor a member of the set S:= {1, 2, 3, 6, 9, 11, 18, 19, 22, 27, 33, 43, 51, 57, 67, 99, 102, 123, 163, 177, 187, 267, 627, ?}, with a number $ >= 5*10^10 if it exists at all.

Examples

			Denote a representation in question by the triple [a, b, c].
The representations for n= 1, 2, ..., 10 are:
n=1,   5: [0, 1, 2],
n=2,  10: [0, 1, 3],
n=3,  13: [0, 2, 3],
n=4,  14: [1, 2, 3],
n=5,  17: [0, 1, 4], [2, 2, 3],
n=6,  21: [1, 2, 4],
n=7,  25: [0, 0, 5], [0, 3, 4],
n=8,  26: [0, 1, 5], [1, 3, 4],
n=9,  29: [0, 2, 5], [2, 3, 4]
n=10, 30: [1, 2, 5].
		

Crossrefs

Cf. A224447, A047449 (primitive case).

Programs

  • Mathematica
    representableQ[n_] := Length[ Select[ PowersRepresentations[n, 3, 2], Unequal @@ # && GCD @@ # == 1 & ]] > 0; Select[ Range[130], representableQ] (* Jean-François Alcover, Apr 10 2013 *)

Formula

a(n) is the n-th largest number m satisfying m = a^2 + b^2 + c^2, with a, b, and c integers, 0 <= a < b < c, and gcd(a,b,c) = 1.
a(n) is the n-th largest number m for which A224447(m) > 0.

A224444 Multiplicities for representations of nonnegative numbers as primitive sums of three squares of integers (square 0 allowed).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Apr 08 2013

Keywords

Comments

a(n) = 0, for n >= 1, if there is no representation of n as a sum of three squares (square 0 allowed) with no common factor > 1. a(0) = 0 because gcd(0,0,0) = 0 (not 1). a(n) = k >= 1 if n is representable as a primitive sum of three squares (square 0 allowed) in exactly k ways, if neither the order of the three terms nor the signs of the numbers to be squared are taken into account.
Compare with the multiplicities A000164.
The numbers for which a(n) is not 0 are given in A047449.

Examples

			a(0) = 0 because  0 = 0^2 + 0^2 + 0^2 is the only candidate for a representation but this is not a primitive sum because gcd(0,0,0) = 0, not 1.
a(2) = 1 because the only candidate for a representation of 2 is the triple [a,b,c] = [0,1,1] and this is primitive, because gcd(0,1,1) = 1.
a(9) = 1 because the two candidate triples are [0, 0, 3] and [1, 2, 2] but [0, 0, 3] is not primitive (gcd(0,0,3) =  3). A000164(9) = 2.
a(17) = 2 with the primitive [a,b,c] triples [0, 1, 4] and [2, 2, 3]. A000164(17) = 2 also.
a(41) = 3 = A000164(41) because the candidate triples [0, 4, 5], [1, 2, 6] and [3, 4, 4] are all primitive.
		

Crossrefs

Programs

  • Mathematica
    Table[ Count[ PowersRepresentations[n, 3, 2], pr_ /; GCD @@ pr == 1], {n, 0, 125}] (* Jean-François Alcover, Apr 09 2013 *)

Formula

a(n) = k if n, for n >= 0, has exactly k representations n = a^2 + b^2 + c^2, with a, b and c integers, 0 <= a <= b < = c and gcd(a,b,c) = 1. If there is no such representation a(n) = 0.
Showing 1-8 of 8 results.