|
EXAMPLE
|
Terms k <= 16 and the squares mod k:
1: [0]
2: [0, 1]
3: [0, 1, 1]
4: [0, 1, 0, 1]
5: [0, 1, 4, 4, 1]
8: [0, 1, 4, 1, 0, 1, 4, 1]
12: [0, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1]
16: [0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1]
k = 10 is not a term: in the list of squares mod 10, [0, 1, 4, 9, 6, 5, 6, 9, 4, 1], the numbers 5 and 6 are not squares.
|
|
PROG
|
(PARI) isok(n)=for(k=2, n-1, if(!issquare(lift(Mod(k, n)^2)), return(0))); return(1);
for(n=1, 10^9, if(isok(n), print1(n, ", ")));
(PARI) is(n)=for(k=sqrtint(n)+1, n\2, if(!issquare(k^2%n), return(0))); 1
for(m=10, 10^6, for(k=0, sqrtint(2*m), if(is(t=m^2-k^2), print(t))))
|