cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A057126 Numbers k such that 2 is a square mod k.

This page as a plain text file.
%I A057126 #30 Jul 15 2025 18:26:51
%S A057126 1,2,7,14,17,23,31,34,41,46,47,49,62,71,73,79,82,89,94,97,98,103,113,
%T A057126 119,127,137,142,146,151,158,161,167,178,191,193,194,199,206,217,223,
%U A057126 226,233,238,239,241,254,257,263,271,274,281,287,289,302,311,313,322
%N A057126 Numbers k such that 2 is a square mod k.
%C A057126 Numbers that are not multiples of 4 and for which all odd prime factors are congruent to +/- 1 mod 8. - _Eric M. Schmidt_, Apr 20 2013
%C A057126 Apparently the same as the list of numbers primitively represented by the indefinite quadratic form x^2 - 2y^2 (cf. A035251). - _N. J. A. Sloane_, Jun 11 2014
%C A057126 From _Wolfdieter Lang_, Jul 11 2025: (Start)
%C A057126 Also the negative sequence lists the numbers properly represented by the indefinite quadratic form x^2 - 2*y^2  of discriminant 4*2 = 8. For the proof see the W. Lang paper linked in A385449, Lemma 18, pp. 22-23.
%C A057126 The connection between the proper positive fundamental solutions (X, Y) of X^2 - 2*Y^2 = -a(n), given in A385449, and the solutions (x, y) of x^2 - 2*y^2 = a(n) is (x, y) = (2*Y - X, X - Y). If y becomes nonpositive a transformation with the matrix Mat([3,4], [2,3]) will give the positive proper fundamental solution. See the example section of A385449. See also the Nov 09 2009 comment in A035251 by Franklin T. Adams-Watters for this connection, and for the matrix eq. (38) p. 14 of the mentioned linked paper.
%C A057126 Therefore the previous statement on the representation of a(n) is true.(End)
%H A057126 T. D. Noe, <a href="/A057126/b057126.txt">Table of n, a(n) for n = 1..1000</a>
%H A057126 N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references)
%p A057126 with(numtheory); [seq(mroot(2,2,p),p=1..300)];
%t A057126 ok[n_] := Reduce[ Mod[2 - k^2, n] == 0, k, Integers] =!= False; Prepend[ Select[ Range[400], ok], 1] (* _Jean-François Alcover_, Sep 20 2012 *)
%o A057126 (PARI) isok(n) = issquare(Mod(2,n)); \\ _Michel Marcus_, Feb 19 2016
%Y A057126 Includes the primes in A038873 and these (primes congruent to {1, 2, 7} mod 8) are the prime factors of the terms in this sequence.
%Y A057126 Cf. A008784, A057125, A057127, A057128, A057129, A057757, A035251, A038873.
%Y A057126 Cf. A087780 (number of solutions mod n).
%K A057126 nonn
%O A057126 1,2
%A A057126 _Henry Bottomley_, Aug 10 2000
%E A057126 Checked by _T. D. Noe_, Apr 19 2007