OFFSET
1,2
COMMENTS
Includes the primes in A033203 and these (primes congruent to {1, 2, 3} mod 8) are the prime factors of the terms in this sequence.
Numbers that are not multiples of 4 and for which all odd prime factors are congruent to {1, 3} mod 8. - Eric M. Schmidt, Apr 21 2013
Positive integers primitively represented by x^2 + 2y^2. - Ray Chandler, Jul 22 2014
The set of the divisors of numbers of the form k^2+2. - Michel Lagneau, Jun 28 2015
The number of proper solutions (x, y) with nonnegative x of the positive definite primitive quadratic form x^2 + 2*y*2 (discriminant -8) representing a(n) is 1 for n = 1 and for n >= 2 it is 2^(P_1 + P_3), where P_1 and P_3 are the number of distinct prime divisors of a(n) congruent to 1 and 3 modulo 8, respectively. See the above comments on A033203 and this binary form. - 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)
EXAMPLE
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
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 *)
PROG
(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
(PARI) isok(n) = issquare(Mod(-2, n)); \\ Michel Marcus, Jun 28 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, Aug 10 2000
STATUS
approved