A000401 Numbers of form x^2 + y^2 + 2*z^2.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1
References
- Wacław Sierpiński, Elementary Theory of Numbers, (Ed. A. Schinzel), North-Holland, 1988, see Exercise 4 on p. 395.
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- L. E. Dickson, Integers represented by positive ternary quadratic forms, Bull. Amer. Math. Soc. 33 (1927), 63-70.
- Gabriele Nebe and N. J. A. Sloane, Home page for this lattice.
Crossrefs
Complement of A055039.
Programs
-
Maple
L := [seq(0,i=1..1)]: for x from 0 to 20 do for y from 0 to 20 do for z from 0 to 20 do if member(x^2+y^2+2*z^2, L)=false then L := [op(L), x^2+y^2+2*z^2] fi: od: od: od: L2 := sort(L): for i from 1 to 100 do printf(`%d,`,L2[i]) od:
-
Mathematica
q=16;imax=q^2;Select[Union[Flatten[Table[x^2+y^2+2*z^2,{z,0,q},{y,0,q},{x,0,q}]]],#<=imax&] (* Vladimir Joseph Stephan Orlovsky, Apr 19 2011 *) Select[Range[0, 100], Mod[# / 4^IntegerExponent[#, 4], 16] != 14 &] (* Amiram Eldar, Mar 29 2025 *)
-
Python
def A000401(n): def f(x): return n-1+sum(((x>>i)-7>>3)+1 for i in range(1,x.bit_length(),2)) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Feb 24 2025
Extensions
More terms from James Sellers, May 31 2000
Comments