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

A047449 Numbers that are primitively represented by x^2 + y^2 + z^2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 11, 13, 14, 17, 18, 19, 21, 22, 25, 26, 27, 29, 30, 33, 34, 35, 37, 38, 41, 42, 43, 45, 46, 49, 50, 51, 53, 54, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 73, 74, 75, 77, 78, 81, 82, 83, 85, 86, 89, 90, 91, 93, 94, 97, 98, 99, 101, 102, 105, 106
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

Numbers that are congruent to {1, 2, 3, 5, 6} mod 8.
Union of A047449 and A034045 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and not congruent to 0 mod 4. - Ray Chandler, Sep 05 2004
G.f.: x*(1 + x + x^2 + 2*x^3 + x^4 + 2*x^5) / ( (x^4 + x^3 + x^2 + x + 1)*(x-1)^2 ). - R. J. Mathar, Dec 07 2011
a(n) = a(n-1) + a(n-5) - a(n-6); a(1)=1, a(2)=2, a(3)=3, a(4)=5, a(5)=6, a(6)=9. - Harvey P. Dale, Mar 05 2015

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

A258218 Number of length (4*n-1) bit patterns with 2*n ones that form circulant core of Hadamard matrices of size 4*n.

Original entry on oeis.org

3, 14, 22, 30, 38, 46, 0, 248, 70, 0, 344, 94
Offset: 1

Views

Author

Ratko V. Tomic, May 23 2015

Keywords

Comments

Numbers were obtained via brute force enumeration and checking of Hamming distances for all binomial(4*n-1,2*n) combinations of 4*n-1 length bit strings with exactly 2*n ones.
Each of a(n) bit patterns of length 4*n-1 when shifted 4*n-1 times forms rows of the (4*n-1) X (4*n-1) core of the normalized Hadamard matrix H(4*n).
The numbers a(n) are of the form k(n)*(4*n-1), where k(n) is 0, 1, or an even integer which varies with n. E.g., k=1 for H(4), k=2 for H(8) to H(24), k=0 for H(28) (i.e., no H(28) with circulant core exists), 8 for H(32), 2 for H(36), unknown even number >= 2 for H(40).
The sequence of 4*n numbers for nonzero values of a(n) (i.e., 4, 8, 12, 16, 20, 24, 32, 36, 248) appears to follow in order the subsets of sequences A034045, A010066 and A180490.
All a(n) patterns for n>1 are obtained from k(n)/2 seed patterns via 4*n-1 circular shifts of the seed pattern and their bit reversal.

Examples

			a(1)=3=1*(4*1-1), a(2)=14=2*(4*2-1), a(3)=22=2*(4*3-1), a(4)=30=2*15, a(7)=0, a(8)=248=8*31, a(9)=70=2*35, a(10)=0, a(11)=344=8*43, a(12)=94=2*47.
		

Crossrefs

Cf. A034045, A010066 and A180490 for n values. A321851 concerns Hadamard matrices of quaternion form.

Formula

a(n) = k(n)*(4*n-1), where k(n) is an algorithmically defined function of n yielding 0, 1, or even integers. The algorithm for k(n) consists of enumeration of all combinations C(4*n-1,2*n) with counting of bit patterns that yield Hamming distances between the 2*n-1 circularly shifted pairs of exactly 2*n.

Extensions

a(1)-a(9) confirmed and a(10)-a(12) extended by Minfeng Wang, Apr 25 2024

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

A004014 Norms of vectors in the b.c.c. lattice.

Original entry on oeis.org

0, 3, 4, 8, 11, 12, 16, 19, 20, 24, 27, 32, 35, 36, 40, 43, 44, 48, 51, 52, 56, 59, 64, 67, 68, 72, 75, 76, 80, 83, 84, 88, 91, 96, 99, 100, 104, 107, 108, 115, 116, 120, 123, 128, 131, 132, 136, 139, 140, 144, 147, 148, 152, 155, 160, 163, 164, 168
Offset: 0

Views

Author

Keywords

Comments

Integers such that A004013(n) is nonzero. - Michael Somos, Jul 28 2014
A subsequence of A047458. The complement seems to be 4*A004215. - Andrey Zabolotskiy, Nov 11 2021
From Mohammed Yaseen, Nov 06 2022: (Start)
These are numbers of the form x^2+y^2+z^2 where x, y and z are either all even (including zero) or all odd.
The selection rule for the planes with Miller indices (hkl) to undergo X-ray diffraction in an f.c.c. lattice is h^2+k^2+l^2 = N where N is a term of this sequence. See A000378 for simple cubic lattice. (End)

References

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

Crossrefs

Union of A034045 and A017101. - Mohammed Yaseen, Nov 06 2022

Programs

  • Maple
    f:= JacobiTheta2(0,z^4)^3+JacobiTheta3(0,z^4)^3:
    S:= series(f,z,1001):
    select(t -> coeff(S,z,t) <> 0, [$0..1000]); # Robert Israel, Oct 18 2015
  • Mathematica
    f = EllipticTheta[2, 0, z^4]^3 + EllipticTheta[3, 0, z^4]^3; S = f + O[z]^200; Flatten[Position[CoefficientList[S, z], ?Positive] - 1] (* _Jean-François Alcover, Oct 23 2016, after Robert Israel *)

Extensions

More terms from Sean A. Irvine, Oct 17 2015
Showing 1-6 of 6 results.