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.

Showing 1-2 of 2 results.

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

A102288 a(n) = 1 + (the n-th term in sequence A_n, ignoring the offset), or a(n) = -1 if A_n has fewer than n terms.

Original entry on oeis.org

1, 3, 2, 1, 3, 4, 1, 7, 7, 5, 45, 2, 181, 43, 17, 1097, 7653, 13782, 9, 24001, 119780, 458562, 152116956851941670913, 1054536, -52, 27, 28, 60, 4806079, 3, 35792569, 3010350, 2387010102192469724605148123694256129, 3, 1, -52, 44, 1, -4096, 174, 37339, 111111111111111111111111111111111111111112, 30402458, 413927967
Offset: 1

Views

Author

Alexandre Wajnberg, Feb 19 2005

Keywords

Comments

a(n) = A091967(n) + 1, except when A_n has fewer than n terms, in which case a(n) = -1. Of course this means that a value a(n) = -1 could arise in two different ways, but it will be easy to decide which. - N. J. A. Sloane, Nov 27 2016
What is a(102288)?!
See A091967 and A051070 for much more about this type of sequence. See A107357 for the variant which respects the offset of A_n (and therefore isn't affected when a sequence is completed by missing initial values).
The definition of this sequence is used in the traditional 'diagonal' proof that there are uncountably many integer sequences. - Simon Nickerson (simonn(AT)maths.bham.ac.uk), Jun 28 2005
The term a(102288) has no possible value according to the present definition, so the definition of this term should be changed, including the possibility that the sequence is defined to be finite, with fewer than 102288 terms. (In that case, the (former, impossible) definition which would say that a(102288) = -1 because A102288 has fewer than 102288 terms, does not apply.) - The term a(47) is currently unknown, since A000047 is known only up to n = 35. - M. F. Hasler, Jan 20 2017
I disagree with the previous comment! I prefer the present, deliberately paradoxical, definition. - N. J. A. Sloane, Jan 20 2017

Examples

			a(53) = -1 since A000053 has only 29 terms.
		

Crossrefs

a(n) = A091967(n) + 1. See also A051070, A107357 (the same but respecting the offset).

Extensions

Corrected and extended by N. J. A. Sloane, May 25 2005
Offset corrected by M. F. Hasler, Sep 22 2013
Corrected and extended by Daniel Sterman, Nov 27 2016
Definition revised by N. J. A. Sloane, Nov 27 2016
a(1) fixed by Daniel Sterman, Nov 28 2016
a(26) corrected by M. F. Hasler, Jan 20 2017
Showing 1-2 of 2 results.