OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
EXAMPLE
7^2 == 7 (mod 14), so 14 is a term.
5^2 == 7 (mod 18) and 13^2 == 7 (mod 18), so 18 is a term.
MAPLE
with(numtheory):
a:= proc(n) option remember; local k;
for k from 1+`if`(n=1, 0, a(n-1))
while mroot(7, 2, k)=FAIL do od; k
end:
seq(a(n), n=1..80); # Alois P. Heinz, Feb 24 2017
MATHEMATICA
Join[{1}, Table[If[Reduce[x^2 == 7, Modulus->n] === False, Null, n], {n, 2, 300}]//Union] (* Vincenzo Librandi, Oct 05 2015 *)
PROG
(PARI) for(n=1, 300, if (issquare(Mod(7, n)), print1(n", "))); \\ Altug Alkan, Oct 04 2015
(Magma) [n: n in [1..300] | exists(t){x : x in ResidueClassRing(n) | x^2 eq 7}]; // Vincenzo Librandi, Oct 05 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Erik Pelttari, Oct 04 2015
STATUS
approved