A057127 -2 is a square mod n.
1, 2, 3, 6, 9, 11, 17, 18, 19, 22, 27, 33, 34, 38, 41, 43, 51, 54, 57, 59, 66, 67, 73, 81, 82, 83, 86, 89, 97, 99, 102, 107, 113, 114, 118, 121, 123, 129, 131, 134, 137, 139, 146, 153, 162, 163, 166, 171, 177, 178, 179, 187, 193, 194, 198, 201, 209, 211, 214, 219
Offset: 1
Keywords
Examples
Binary quadratic form x^2 + 2*y^2 representing a(n), with x >= 0: a(1) = 1: one solution (x, y) = (1,0); a(2) = 2: one solution (0,1); a(3) = 3: two solutions (1, pm 1), with pm = +1 or -1; a(5) = 9 = 3^2: two solutions (1, pm 2); a(12) = 33 = 3*11: 4 solutions (1, pm 4) and (5, pm 2); a(137) = 3*11*17 = 561: eight solutions (7, pm 16), (13, pm 14), (19, pm 10) and (23, pm 4). - _Wolfdieter Lang_, Feb 25 2021
Links
- Eric M. Schmidt, Table of n, a(n) for n = 1..1000
- N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
Programs
-
Maple
select(n -> numtheory:-msqrt(-2,n) <> FAIL, [$1..1000]); # Robert Israel, Jun 29 2015
-
Mathematica
Select[Range[300], IntegerQ[PowerMod[-2, 1/2, #]]&] // Quiet (* Jean-François Alcover, Mar 04 2019 *)
-
PARI
isok(n) = issquare(Mod(-2, n)); \\ Michel Marcus, Jun 28 2015
-
Sage
def isA057127(n): if n % 4 == 0: return False return all(p % 8 in [1, 2, 3] for p, _ in factor(n)) [n for n in range(1, 300) if isA057127(n)] # Eric M. Schmidt, Apr 21 2013
Comments