A035251 Positive numbers of the form x^2 - 2y^2 with integers x, y.
1, 2, 4, 7, 8, 9, 14, 16, 17, 18, 23, 25, 28, 31, 32, 34, 36, 41, 46, 47, 49, 50, 56, 62, 63, 64, 68, 71, 72, 73, 79, 81, 82, 89, 92, 94, 97, 98, 100, 103, 112, 113, 119, 121, 124, 126, 127, 128, 136, 137, 142, 144, 146, 151, 153, 158, 161, 162, 164, 167, 169, 175, 178
Offset: 1
Keywords
Examples
The (x,y) pairs, with minimum x, that solve the equation are (1,0), (2,1), (2,0), (3,1), (4,2), (3,0), (4,1), (4,0), (5,2), (6,3), (5,1), (5,0), (6,2), (7,3), (8,4), (6,1), (6,0), (7,2), (8,3), (7,1), (7,0), (10,5), (8,2), ... If the positive number is a perfect square, y=0 yields a trivial solution. - _R. J. Mathar_, Sep 10 2016
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
- K. Matthews, Thue's theorem and the diophantine equation x^2-D*y^2=+-N, Math. Comp. 71 (239) (2002) 1281-1286.
- K. Matthews, Solving the diophantine equation x^2-D*y^2=N, D>0, (2016).
- Sci.math, General Pell equation: x^2 - N*y^2 = D, 1998
- Sci.math, General Pell equation: x^2 - N*y^2 = D, 1998 [Edited and cached copy]
- N. J. A. Sloane et al., Binary Quadratic Forms and OEIS (Index to related sequences, programs, references)
Crossrefs
Primes: A038873.
Programs
-
Maple
filter:= proc(n) local F; F:= select(t -> t[1] mod 8 = 3 or t[1] mod 8 = 5, ifactors(n)[2]); map(t -> t[2],F)::list(even); end proc: select(filter, [$1..1000]); # Robert Israel, Dec 01 2015
-
Mathematica
Reap[For[n = 1, n < 200, n++, r = Reduce[x^2 - 2 y^2 == n, {x, y}, Integers]; If[r =!= False, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Oct 31 2016 *)
-
PARI
select(x -> x, direuler(p=2,201,1/(1-(kronecker(2,p)*(X-X^2))-X)), 1) \\ Fixed by Andrey Zabolotskiy, Jul 30 2020
-
PARI
{a(n) = my(m, c); if( n<1, 0, c=0; m=0; while( c
Michael Somos, Aug 17 2006 */ -
PARI
is(n)=#bnfisintnorm(bnfinit(z^2-2),n) \\ Ralf Stephan, Oct 14 2013
-
Python
from itertools import count, islice from sympy import factorint def A035251_gen(): # generator of terms return filter(lambda n:all(not((2 < p & 7 < 7) and e & 1) for p, e in factorint(n).items()),count(1)) A035251_list = list(islice(A035251_gen(),30)) # Chai Wah Wu, Jun 28 2022
Extensions
Better description from Sharon Sela (sharonsela(AT)hotmail.com), Mar 10 2002
Comments