A270781 Numbers n with the property that n is both of the form p^2 + q^2 + r^2 + s^2 for some primes p, q, r, and s, and not of the form a^2 + b^2 + c^2 for any integers a, b, and c.
31, 47, 63, 71, 79, 87, 92, 103, 111, 124, 127, 143, 151, 156, 159, 175, 183, 188, 191, 199, 207, 220, 223, 231, 247, 252, 255, 271, 295, 303, 311, 316, 319, 327, 343, 348, 351, 367, 383, 391, 399, 412, 415, 423, 439, 444, 463, 471, 476, 487
Offset: 1
Keywords
Examples
31 = 2^2 + 3^2 + 3^2 + 3^2, and, according to Legendre's three-square theorem, 31 cannot be expressed as the sum of three squares, so 31 is a term.
Links
- Griffin N. Macris, Table of n, a(n) for n = 1..500
Programs
-
Sage
n=487 #change for more terms P=prime_range(1,ceil(sqrt(n))) S=cartesian_product_iterator([P,P,P,P]) A=list(Set([sum(i^2 for i in y) for y in S if sum(i^2 for i in y)<=n])) A.sort() T=[sum(i^2 for i in y) for y in cartesian_product_iterator([[0..ceil(sqrt(n))],[0..ceil(sqrt(n))],[0..ceil(sqrt(n))]])] [x for x in A if not(x in T)] # Tom Edgar, Mar 24 2016
Comments