|
|
A355778
|
|
Numbers k such that both k and k^2 + 2 can be written as the sum of two nonzero squares.
|
|
0
|
|
|
40, 68, 72, 104, 148, 180, 320, 392, 468, 544, 612, 648, 720, 788, 832, 900, 936, 968, 1040, 1044, 1156, 1192, 1256, 1300, 1332, 1508, 1732, 1796, 1800, 1832, 1872, 1940, 2056, 2196, 2308, 2336, 2372, 2448, 2664, 2696, 2740, 2804, 2848, 2880, 3060, 3200, 3280
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The terms in this sequence can be considered as a solution to the "near miss" problem which occurs frequently while solving Diophantine equations. It is known that if a number k can be written as the sum of two nonzero distinct squares then so can k^2 and k^2+1. Thus, finding numbers k such that k^2+2 satisfies the same property makes it quite interesting.
|
|
LINKS
|
|
|
EXAMPLE
|
40 is a term since 40 = 2^2 + 6^2 as well as 40^2 + 2 = 1602 = 9^2 + 39^2.
320 is a term since 320 = 8^2 + 16^2 as well as 320^2 + 2 = 102402 = 201^2 + 249^2.
|
|
PROG
|
(PARI) is1(n)= for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)); \\ A000404
(Python)
from itertools import count, islice
from sympy import factorint
def A355778_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
c = False
for p in (f:=factorint(n)):
if (q:= p & 3)==3 and f[p]&1:
break
elif q == 1:
c = True
else:
if c or f.get(2, 0)&1:
c = False
for p in (f:=factorint(n**2+2)):
if (q:= p & 3)==3 and f[p]&1:
break
elif q == 1:
c = True
else:
if c or f.get(2, 0)&1:
yield n
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|