login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A254328 Numbers k such that all x^2 mod k are squares (including 0 and 1). 3
1, 2, 3, 4, 5, 8, 12, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Are there any more terms > 16?

There are no more terms less than 10^12. Probably the sequence is finite. - Charles R Greathouse IV, Jan 29 2015

This is a subsequence of A303704, so it is full. - Jianing Song, Feb 14 2019

LINKS

Table of n, a(n) for n=1..8.

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.

MATHEMATICA

f[n_] := Mod[Range[n]^2, n]; Select[Range@ 10000, AllTrue[f@ #, IntegerQ[Sqrt[#]] &] &] (* AllTrue function introduced in version 10; Michael De Vlieger, Jan 29 2015 *)

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))))

\\ Charles R Greathouse IV, Jan 29 2015

CROSSREFS

Cf. A065428, A254329, A096008, A303704.

Sequence in context: A179402 A065428 A059747 * A094087 A225132 A240216

Adjacent sequences:  A254325 A254326 A254327 * A254329 A254330 A254331

KEYWORD

nonn,fini,full

AUTHOR

Joerg Arndt, Jan 28 2015

EXTENSIONS

Keywords fini and full added by Jianing Song, Feb 14 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 15 14:06 EST 2019. Contains 329149 sequences. (Running on oeis4.)