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.

A035251 Positive numbers of the form x^2 - 2y^2 with integers x, y.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

x^2 - 2y^2 has discriminant 8. - N. J. A. Sloane, May 30 2014
A positive number n is representable in the form x^2 - 2y^2 iff every prime p == 3 or 5 (mod 8) dividing n occurs to an even power.
Indices of nonzero terms in expansion of Dirichlet series Product_p (1-(Kronecker(m,p)+1)*p^(-s)+Kronecker(m,p)*p^(-2s))^(-1) for m=2 (A035185). [amended by Georg Fischer, Sep 03 2020]
Also positive numbers of the form 2x^2 - y^2. If x^2 - 2y^2 = n, 2(x+y)^2 - (x+2y)^2 = n. - Franklin T. Adams-Watters, Nov 09 2009
Except 2, prime numbers in this sequence have the form p=8k+-1. According to the first comment, prime factors of the forms (8k+-3),(8k+-5) occur in x^2 - 2y^2 in even powers. If x^2 - 2y^2 is a prime number, those powers must be 0. Only factors 8k+-1 remain. Example: 137=8*17+1. - Jerzy R Borysowicz, Nov 04 2015
The product of any two terms of the sequence is a term too. A proof follows from the identity: (a^2-2b^2)(c^2-2d^2) = (2bd+ac)^2 - 2(ad+bc)^2. Example: 127*175 has form x^2-2y^2, with x=9335, y=6600. - Jerzy R Borysowicz, Nov 28 2015
Primitive terms (not a product of earlier terms that are greater than 1 in the sequence) are A055673 except 1. - Charles R Greathouse IV, Sep 10 2016
Positive numbers of the form u^2 + 2uv - v^2. - Thomas Ordowski, Feb 17 2017
For integer numbers z, a, k and z^2+a^2>0, k>=0: z^(4k) + a^4 is in A035251 because z^(4k) + a^4 = (z^(2k) + a^2)^2 - 2(a*z^k)^2. Assume 0^0 = 1. Examples: 3^4 + 1^4 = 82, 3^8+4^4=6817. - Jerzy R Borysowicz, Mar 09 2017
Numbers that are the difference between two legs of a Pythagorean right triangle. - Michael Somos, Apr 02 2017

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
		

Crossrefs

Primes: A038873.
Complement of A232531. - Thomas Ordowski and Altug Alkan, Feb 09 2017

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( cMichael 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