A057125 Numbers n such that 3 is a square mod n.
1, 2, 3, 6, 11, 13, 22, 23, 26, 33, 37, 39, 46, 47, 59, 61, 66, 69, 71, 73, 74, 78, 83, 94, 97, 107, 109, 111, 118, 121, 122, 131, 138, 141, 142, 143, 146, 157, 166, 167, 169, 177, 179, 181, 183, 191, 193, 194, 213, 214, 218, 219, 222, 227, 229, 239, 241, 242
Offset: 1
Keywords
Examples
3^2==3 (mod 6), so 6 is a member.
Links
- T. D. Noe, Table of n, a(n) for n=1..1000
Crossrefs
Programs
-
Magma
[n: n in [1..300] | exists(t){x : x in ResidueClassRing(n) | x^2 eq 3}]; // Vincenzo Librandi, Feb 20 2016
-
Maple
# Beware: Since 2007 at least and up to Maple 16 at least, the following Maple code returns the wrong answer for n = 6: with(numtheory): [seq(`if`(mroot(3,2,n)=FAIL,NULL,n), n=1..400)]; # second Maple program: with(numtheory): mroot(3, 2, 6):=3: a:= proc(n) option remember; local m; for m from 1+`if`(n=1, 0, a(n-1)) while mroot(3, 2, m)=FAIL do od; m end: seq(a(n), n=1..80); # Alois P. Heinz, Feb 24 2017
-
Mathematica
Prepend[ Select[ Range[300], Reduce[Mod[3 - k^2, #] == 0, k, Integers] =!= False &], 1] (* Jean-François Alcover, Sep 20 2012 *)
-
PARI
isok(n) = issquare(Mod(3,n)); \\ Michel Marcus, Feb 19 2016
Extensions
Edited by N. J. A. Sloane, Oct 25 2008 at the suggestion of R. J. Mathar.
Comments