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-10 of 14 results. Next

A154782 Least integer y>=0 such that n+2y^2 is a square; -1 if n is not in A035251.

Original entry on oeis.org

0, 0, 1, -1, 0, -1, -1, 1, 2, 0, -1, -1, -1, -1, 1, -1, 0, 2, 3, -1, -1, -1, -1, 1, -1, 0, -1, -1, 2, -1, -1, 3, 4, -1, 1, -1, 0, -1, -1, -1, -1, 2, -1, -1, -1, -1, 3, 1, -1, 0, 5, -1, -1, -1, -1, -1, 2, -1, -1, -1, -1, -1, 1, 3, 0, -1, -1, -1, 4, -1, -1, 5, 6, 2, -1, -1, -1, -1, -1, 1, -1, 0
Offset: 0

Views

Author

M. F. Hasler, Jan 19 2009

Keywords

Crossrefs

Cf. A035251.

Programs

  • PARI
    A154782(n)={for(y=0,sqrtint(n\2),issquare(n+2*y^2)&return(y));-1}

A038873 Primes p such that 2 is a square mod p; or, primes congruent to {1, 2, 7} mod 8.

Original entry on oeis.org

2, 7, 17, 23, 31, 41, 47, 71, 73, 79, 89, 97, 103, 113, 127, 137, 151, 167, 191, 193, 199, 223, 233, 239, 241, 257, 263, 271, 281, 311, 313, 337, 353, 359, 367, 383, 401, 409, 431, 433, 439, 449, 457, 463, 479, 487, 503, 521, 569, 577, 593, 599, 601, 607, 617
Offset: 1

Views

Author

Keywords

Comments

Same as A001132 except for initial term.
Primes p such that x^2 = 2 has a solution mod p.
The primes of the form x^2 + 2xy - y^2 coincide with this sequence. These are also primes of the form u^2 - 2v^2. - Tito Piezas III, Dec 28 2008
Therefore these are composite in Z[sqrt(2)], as they can be factored as (u^2 - 2v^2)*(u^2 + 2v^2). - Alonso del Arte, Oct 03 2012
After a(1) = 2, these are the primes p such that p^4 == 1 (mod 96). - Gary Detlefs, Jan 22 2014
Also primes of the form 2v^2 - u^2. For example, 23 = 2*4^2 - 3^2. - Jerzy R Borysowicz, Oct 27 2015
Prime factors of A008865 and A028884. - Klaus Purath, Dec 07 2020

References

  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Theorem 5-5, p. 68.

Crossrefs

Cf. A057126, A087780, A226523, A003629 (complement).
Primes in A035251.
For primes p such that x^m == 2 mod p has a solution for m = 2,3,4,5,6,7,... see A038873, A040028, A040098, A040159, A040992, A042966, ...

Programs

  • Magma
    [ p: p in PrimesUpTo(617) | IsSquare(R!2) where R:=ResidueClassRing(p) ]; // Klaus Brockhaus, Dec 02 2008
    
  • Maple
    seq(`if`(member(ithprime(n) mod 8, {1,2,7}),ithprime(n),NULL),n=1..113); # Nathaniel Johnston, Jun 26 2011
  • Mathematica
    fQ[n_] := MemberQ[{1, 2, 7}, Mod[n, 8]]; Select[ Prime[Range[114]], fQ] (* Robert G. Wilson v, Oct 18 2011 *)
  • PARI
    is(n)=isprime(n) && issquare(Mod(2,n)) \\ Charles R Greathouse IV, Apr 23 2015
    
  • PARI
    is(n)=abs(centerlift(Mod(n,8)))<3 && isprime(n) \\ Charles R Greathouse IV, Nov 14 2017

Formula

a(n) ~ 2n log n. - Charles R Greathouse IV, Nov 29 2016

A002479 Numbers of the form x^2 + 2*y^2.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 9, 11, 12, 16, 17, 18, 19, 22, 24, 25, 27, 32, 33, 34, 36, 38, 41, 43, 44, 48, 49, 50, 51, 54, 57, 59, 64, 66, 67, 68, 72, 73, 75, 76, 81, 82, 83, 86, 88, 89, 96, 97, 98, 99, 100, 102, 107, 108, 113, 114, 118, 121, 123, 128, 129, 131
Offset: 1

Views

Author

Keywords

Comments

A positive number k belongs to this sequence if and only if every prime p == 5, 7 (mod 8) dividing k occurs to an even power. - Sharon Sela (sharonsela(AT)hotmail.com), Mar 23 2002
Norms of numbers in Z[sqrt(-2)]. - Alonso del Arte, Sep 23 2014
Euler (E256) shows that these numbers are closed under multiplication, according to the Euler Archive. - Charles R Greathouse IV, Jun 16 2016
In addition to the previous comment: The proof was already given 1100 years before Euler by Brahmagupta's identity (a^2 + m*b^2)*(c^2 + m*d^2) = (a*c - m*b*d)^2 + m*(a*d + b*c)^2. - Klaus Purath, Oct 07 2023

References

  • L. Euler, (E388) Vollstaendige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 421.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 59.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A097700. Subsequence of A000408. For primes see A033203.

Programs

  • Haskell
    a002479 n = a002479_list !! (n-1)
    a002479_list = 0 : filter f [1..] where
       f x = all (even . snd) $ filter ((`elem` [5,7]) . (`mod` 8) . fst) $
                                zip (a027748_row x) (a124010_row x)
    -- Reinhard Zumkeller, Feb 20 2014
    
  • Magma
    [n: n in [0..131] | NormEquation(2, n) eq true]; // Arkadiusz Wesolowski, May 11 2016
    
  • Maple
    lis:={}; M:=50; M2:=M^2;
    for x from 0 to M do for y from 0 to M do
    if x^2+2*y^2 <= M2 then lis:={op(lis),x^2+2*y^2}; fi; od: od:
    sort(convert(lis,list)); # N. J. A. Sloane, Apr 30 2015
  • Mathematica
    q = 16; imax = q^2; Select[Union[Flatten[Table[x^2 + 2y^2, {y, 0, q/Sqrt[2]}, {x, 0, q}]]], # <= imax &] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
    Union[#[[1]]+2#[[2]]&/@Tuples[Range[0,10]^2,2]] (* Harvey P. Dale, Nov 24 2014 *)
  • PARI
    is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,1]%8>4 && f[i,2]%2, return(0)));1 \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    list(lim)=my(v=List()); for(a=0,sqrtint(lim\=1), for(b=0,sqrtint((lim-a^2)\2), listput(v,a^2+2*b^2))); Set(v) \\ Charles R Greathouse IV, Jun 16 2016
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A002479_gen(): # generator of terms
        return filter(lambda n:all(p & 7 < 5 or e & 1 == 0 for p, e in factorint(n).items()),count(0))
    A002479_list = list(islice(A002479_gen(),30)) # Chai Wah Wu, Jun 27 2022

A035185 Number of divisors of n == 1 or 7 (mod 8) minus number of divisors of n == 3 or 5 (mod 8).

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 2, 1, 1, 0, 0, 0, 0, 2, 0, 1, 2, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 2, 0, 0, 2, 1, 0, 2, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 3, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 2, 1, 0, 0, 0, 2, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 2, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 0, 2, 3, 0, 1, 0, 0, 2, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Coefficients in expansion of Dirichlet series Product_p (1-(Kronecker(m,p)+1)*p^(-s) + Kronecker(m,p)*p^(-2s))^(-1) for m = 2.
Let zetaQ(sqrt(2))(s) = Sum (1/(Z(sqrt(2)):A)^s), a Dedekind zeta function, where A runs through the nonzero ideals of Z(sqrt(2)) and where (Z(sqrt(2)):A) is the norm of A; then zetaQ(sqrt(2))(s) = Sum_{n>=1}, a(n)/n^s); Sum{k=1..n} a(k) is asymptotic to c*n where c = log(1 + sqrt(2))/sqrt(2). - Benoit Cloitre, Jan 01 2003
Inverse Moebius transform of A091337.
a(n) is the number of solutions to the equation n = x^2 - 2*y^2 in integers where -x < 2*y <= x. [Uspensky and Heaslet] - Michael Somos, Feb 17 2020
Coefficients of Dedekind zeta function for the quadratic number field of discriminant 8. See A002324 for formula and Maple code. - N. J. A. Sloane, Mar 22 2022

Examples

			G.f. = x + x^2 + x^4 + 2*x^7 + x^8 + x^9 + 2*x^14 + x^16 + 2*x^17 + x^18 + ...
a(7) = 2 because 7 = 3^2 - 2*(+1)^2 = 3^2 - 2*(-1)^2. - _Michael Somos_, Feb 17 2020
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 368.

Crossrefs

Moebius transform gives A091337.
Dedekind zeta functions for imaginary quadratic number fields of discriminants -3, -4, -7, -8, -11, -15, -19, -20 are A002324, A002654, A035182, A002325, A035179, A035175, A035171, A035170, respectively.
Dedekind zeta functions for real quadratic number fields of discriminants 5, 8, 12, 13, 17, 21, 24, 28, 29, 33, 37, 40 are A035187, A035185, A035194, A035195, A035199, A035203, A035188, A035210, A035211, A035215, A035219, A035192, respectively.

Programs

  • Mathematica
    a[ n_] := If[ n < 1, 0, DivisorSum[ n, KroneckerSymbol[ 2, #] &]]; (* Michael Somos, Jul 06 2015 *)
    a[ n_] := SeriesCoefficient[ Sum[ x^k (1 - x^(2 k)) / (1 + x^(4 k)), {k, n}], {x, 0, n}]; (* Michael Somos, Jul 06 2015 *)
    a[ n_] := If[ n < 1, 0, Times @@ (Which[ # <= 2, 1, Mod[#, 8] > 1 && Mod[#, 8] < 7, 1 - Mod[#2, 2], True, #2 + 1] & @@@ FactorInteger @ n)]; (* Michael Somos, Jul 06 2015 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, kronecker(2, d)))};
    
  • PARI
    {a(n) = if( n<1, 0, direuler(p=2, n, 1 / ((1 - X) * (1 - kronecker(2, p)*X)))[n])};
    
  • PARI
    {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if(p==2, 1, p%8>1 && p%8<7, !(e%2), e+1)))}; \\ Michael Somos, Aug 17 2006
    
  • PARI
    {a(n) = if( n<1, 0, polcoeff( sum(k=1, n, x^k * (1 - x^(2*k)) / (1 + x^(4*k)), x * O(x^n)), n))}; \\ Michael Somos, Jul 06 2015

Formula

G.f.: Sum_{k>0} x^k * (1 - x^(2*k)) / (1 + x^(4*k)).
-(-1)^(n*(n-1)/2)*a(n) = Sum_{n >= 1} (-1)^n * q^(n*(n+1)/2)*(1-q)*(1-q^2)*...*(1-q^(n-1))/ ((1+q)*(1+q^2)*...*(1+q^n)). - Jeremy Lovejoy, Jun 12 2009
a(n) = (-1)^floor(n/2) * A259829(n). - Michael Somos, Jul 06 2015
a(n) is multiplicative with a(2^e) = 1, a(p^e) = (1 + (-1)^e) / 2 if p == 3, 5 (mod 8), a(p^e) = e + 1 if p == 1, 7 (mod 8). - Jianing Song, Sep 07 2018
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = log(sqrt(2)+1)/sqrt(2) = A091648/A002193 = 0.623225... . - Amiram Eldar, Oct 11 2022

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

Original entry on oeis.org

1, 2, 7, 14, 17, 23, 31, 34, 41, 46, 47, 49, 62, 71, 73, 79, 82, 89, 94, 97, 98, 103, 113, 119, 127, 137, 142, 146, 151, 158, 161, 167, 178, 191, 193, 194, 199, 206, 217, 223, 226, 233, 238, 239, 241, 254, 257, 263, 271, 274, 281, 287, 289, 302, 311, 313, 322
Offset: 1

Views

Author

Henry Bottomley, Aug 10 2000

Keywords

Comments

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
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
From Wolfdieter Lang, Jul 11 2025: (Start)
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.
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.
Therefore the previous statement on the representation of a(n) is true.(End)

Crossrefs

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.
Cf. A087780 (number of solutions mod n).

Programs

  • Maple
    with(numtheory); [seq(mroot(2,2,p),p=1..300)];
  • Mathematica
    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 *)
  • PARI
    isok(n) = issquare(Mod(2,n)); \\ Michel Marcus, Feb 19 2016

Extensions

Checked by T. D. Noe, Apr 19 2007

A084917 Positive numbers of the form 3*y^2 - x^2.

Original entry on oeis.org

2, 3, 8, 11, 12, 18, 23, 26, 27, 32, 39, 44, 47, 48, 50, 59, 66, 71, 72, 74, 75, 83, 92, 98, 99, 104, 107, 108, 111, 122, 128, 131, 138, 143, 146, 147, 156, 162, 167, 176, 179, 183, 188, 191, 192, 194, 200, 207, 218, 219, 227, 234, 236, 239, 242, 243, 251, 263, 264, 275, 282, 284
Offset: 1

Views

Author

Roger Cuculière, Jul 14 2003

Keywords

Comments

Positive integers k such that x^2 - 4xy + y^2 + k = 0 has integer solutions. (See the CROSSREFS section for sequences relating to solutions for particular k.)
Comments on method used, from Colin Barker, Jun 06 2014: (Start)
In general, we want to find the values of f, from 1 to 400 say, for which x^2 + bxy + y^2 + f = 0 has integer solutions for a given b.
In order to solve x^2 + bxy + y^2 + f = 0 we can solve the Pellian equation x^2 - Dy^2 = N, where D = b*b - 4 and N = 4*(b*b - 4)*f.
But since sqrt(D) < N, the classical method of solving x^2 - Dy^2 = N does not work. So I implemented the method described in the 1998 sci.math reference, which says:
"There are several methods for solving the Pellian equation when |N| > sqrt(d). One is to use a brute-force search. If N < 0 then search on y = sqrt(abs(n/d)) to sqrt((abs(n)(x1 + 1))/(2d)) and if N > 0 search on y = 0 to sqrt((n(x1 - 1))/(2d)) where (x1, y1) is the minimum positive solution (x, y) to x^2 - dy^2 = 1. If N < 0, for each positive (x, y) found by the search, also take (-x, y). If N > 0, also take (x, -y). In either case, all positive solutions are generated from these using (x1, y1) in the standard way."
Incidentally all my Pell code is written in B-Prolog, and is somewhat voluminous. (End)
Also, positive integers of the form -x^2 + 2xy + 2y^2 of discriminant 12. - N. J. A. Sloane, May 31 2014 [Corrected by Klaus Purath, May 07 2023]
The equivalent sequence for x^2 - 3xy + y^2 + k = 0 is A031363.
The equivalent sequence for x^2 - 5xy + y^2 + k = 0 is A237351.
A positive k does not appear in this sequence if and only if there is no integer solution of x^2 - 3*y^2 = -k with (i) 0 < y^2 <= k/2 and (ii) 0 <= x^2 <= k/2. See the Nagell reference Theorems 108 a and 109, pp. 206-7, with D = 3, N = k and (x_1,y_1) = (2,1). - Wolfdieter Lang, Jan 09 2015
From Klaus Purath, May 07 2023: (Start)
There are no squares in this sequence. Products of an odd number of terms as well as products of an odd number of terms and any terms of A014209 belong to the sequence.
Products of an even number of terms are terms of A014209. The union of this sequence and A014209 is closed under multiplication.
A positive number belongs to this sequence if and only if it contains an odd number of prime factors congruent to {2, 3, 11} modulo 12. If it contains prime factors congruent to {5, 7} modulo 12, these occur only with even exponents. (End)
From Klaus Purath, Jul 09 2023: (Start)
Any term of the sequence raised to an odd power also belongs to the sequence. Proof: t^(2n+1) = t*t^2n = (3*x^2 - y^2)*t^2n = 3*(x*t^n)^2 - (y*t^n)^2. It seems that t^(2n+1) occurs only if t also is in the sequence.
Joerg Arndt has proved that there are no squares in this sequence: Assume s^2 = 3*y^2 - x^2, then s^2 + x^2 = 3 * y^2, but the sum of two squares cannot be 3 * y^2, qed. (End)
That products of any 3 terms belong to the sequence can be proved by the following identity: (na^2 - b^2) (nc^2 - d^2) (ne^2 - f^2) = n[a(nce + df) + b(cf + de)]^2 - [na(cf + de) + b(nce + df)]^2. This can be verified by expanding both sides of the equation. - Klaus Purath, Jul 14 2023

Examples

			11 is in the sequence because 3 * 3^2 - 4^2 = 27 - 16 = 11.
12 is in the sequence because 3 * 4^2 - 6^2 = 48 - 36 = 12.
13 is not in the sequence because there is no solution in integers to 3y^2 - x^2 = 13.
From _Wolfdieter Lang_, Jan 09 2015: (Start)
Referring to the Jan 09 2015 comment above.
k = 1 is out because there is no integer solution of (i) 0 < y^2 <= 1/2.
For k = 4, 5, 6, and 7 one has y = 1, x = 0, 1 (and the negative of this). But x^2 - 3 is not -k for these k and x values. Therefore, these k values are missing.
For k = 8 .. 16 one has y = 1, 2 and x = 0, 1, 2. Only y = 2 has a chance and only for k = 8, 11 and 12 the x value 2, 1 and 0, respectively, solves x^2 - 12 = -k. Therefore 9, 10, 13, 14, 15, 16 are missing.
... (End)
		

References

  • T. Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964.

Crossrefs

With respect to solutions of the equation in the early comment, see comments etc. in: A001835 (k = 2), A001075 (k = 3), A237250 (k = 11), A003500 (k = 12), A082841 (k = 18), A077238 (k = 39).
A141123 gives the primes.
For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.

Programs

  • Mathematica
    r[n_] := Reduce[n == 3*y^2 - x^2 && x > 0 && y > 0, {x, y}, Integers]; Reap[For[n = 1, n <= 1000, n++, rn = r[n]; If[rn =!= False, Print["n = ", n, ", ", rn /. C[1] -> 1 // Simplify]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Jan 21 2016 *)
    Select[Range[300],Length[FindInstance[3y^2-x^2==#,{x,y},Integers]]>0&] (* Harvey P. Dale, Apr 23 2023 *)

Extensions

Terms 26 and beyond from Colin Barker, Feb 06 2014

A230044 Nonnegative numbers k such that k plus a perfect square is a triangular number.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 9, 10, 11, 12, 14, 15, 17, 19, 20, 21, 24, 27, 28, 29, 30, 32, 35, 36, 39, 41, 42, 44, 45, 46, 50, 51, 53, 54, 55, 56, 57, 62, 65, 66, 69, 71, 72, 74, 75, 77, 78, 80, 82, 84, 87, 89, 90, 91, 95, 96, 100, 101, 104, 105, 107, 109, 110, 111, 116, 117, 119, 120, 122, 126, 127, 128
Offset: 1

Views

Author

Ralf Stephan, Oct 06 2013

Keywords

Comments

Negative k are in A175035.
Numbers such that the Diophantine equation y^2 + y - 2x^2 = 2n, y > 0 has a solution. Empirically, solutions (x,y) don't exceed (5n,5n) for n < 10^5. Record quotients y/n are at n = 2, 3, 12, 45, 1225, 6806, ...
Conjecture: these are the sorted distinct terms of A064784.
n is in this sequence iff 8n+1 is in A035251, that is, every prime p == 3 or 5 (mod 8) dividing 8n+1 appears to an even power. - Max Alekseyev, Oct 14 2013

Examples

			28 is triangular, and 25 is a square <= 28, and 28-25=3, so 3 is in sequence.
		

Crossrefs

Programs

  • PARI
    B=bnfinit(z^2-8); is(n)=#bnfisintnorm(B,8*n+1) \\ Max Alekseyev, Oct 13 2013

A002334 Least positive integer x such that prime A038873(n) = x^2 - 2y^2 for some y.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 7, 11, 9, 9, 11, 13, 11, 11, 15, 13, 13, 13, 17, 15, 19, 15, 19, 17, 21, 17, 19, 17, 17, 19, 21, 25, 19, 19, 23, 25, 23, 21, 23, 21, 21, 29, 23, 25, 23, 27, 29, 23, 31, 33, 25, 29, 27, 25, 25, 27, 29, 35, 31, 31, 27, 29, 33, 31, 29, 29, 29, 29, 37, 31, 41, 35
Offset: 1

Views

Author

Keywords

Comments

A prime p is representable in the form x^2 - 2y^2 iff p is 2 or p == 1 or 7 (mod 8). - Pab Ter (pabrlos2(AT)yahoo.com), Oct 22 2005
From Wolfdieter Lang, Feb 17 2015: (Start)
For the corresponding y terms see A002335.
a(n), together with A002335(n), gives the fundamental positive solution of the first class of this (generalized) Pell equation. The prime 2 has only one class of proper solutions. The fundamental positive solutions of the second class for the primes from A001132 are given in A254930 and A254931. (End)

Examples

			The first solutions [x(n), y(n)] are (the prime is given as first entry): [2,[2,1]], [7,[3,1]], [17,[5,2]], [23,[5,1]], [31,[7,3]], [41,[7,2]], [47,[7,1]], [71,[11,5]], [73,[9,2]], [79,[9,1]], [89,[11,4]], [97,[13,6]], [103,[11,3]], [113,[11,2]], [127,[15,7]], [137,[13,4]], [151,[13,3]], [167,[13,1]], [191,[17,7]], [193,[15,4]], [199,[19,9]], [223,[15,1]], [233,[19,8]], [239,[17,5]], [241,[21,10]], [257,[17,4]], [263,[19,7]], [271,[17,3]], ... - _Wolfdieter Lang_, Feb 17 2015
		

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    with(numtheory): readlib(issqr): for i from 1 to 250 do p:=ithprime(i): pmod8:=modp(p,8): if p=2 or pmod8=1 or pmod8=7 then for y from 1 do x2:=p+2*y^2: if issqr(x2) then printf("%d,",sqrt(x2)): break fi od fi od: # Pab Ter, May 08 2004
  • Mathematica
    maxPrimePi = 200;
    Reap[Do[If[MatchQ[Mod[p, 8], 1|2|7], rp = Reduce[x > 0 && y > 0 && p == x^2 - 2*y^2, {x, y}, Integers]; If[rp =!= False, xy = {x, y} /. {ToRules[rp /. C[1] -> 1]}; x0 = xy[[All, 1]] // Min // Simplify; Print[{p, xy[[1]]} ]; Sow[x0]]], {p, Prime[Range[maxPrimePi]]}]][[2, 1]] (* Jean-François Alcover, Oct 27 2019 *)

Formula

a(n)^2 - 2*A002335(n)^2 = A038873(n), n >= 1, and a(n) is the least positive integer satisfying this Pell type equation. - Wolfdieter Lang, Feb 12 2015

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 08 2004
The name has been changed in order to be more precise and to conform with A002335. The offset has been changed to 1. - Wolfdieter Lang, Feb 12 2015

A002335 Least positive integer y such that A038873(n) = x^2 - 2y^2 for some x.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 1, 5, 2, 1, 4, 6, 3, 2, 7, 4, 3, 1, 7, 4, 9, 1, 8, 5, 10, 4, 7, 3, 2, 5, 8, 12, 2, 1, 9, 11, 8, 4, 7, 2, 1, 14, 6, 9, 5, 11, 13, 2, 14, 16, 4, 11, 8, 3, 2, 7, 10, 17, 12, 11, 1, 7, 13, 10, 6, 4, 3, 1, 16, 7, 20, 13, 5, 15, 4, 12, 2, 21, 14, 11, 7, 16, 13, 18, 5, 20, 9, 1, 8, 17, 14
Offset: 1

Views

Author

Keywords

Comments

A prime p is representable in the form x^2-2y^2 iff p is 2 or p == 1 or 7 mod 8. - Pab Ter (pabrlos2(AT)yahoo.com), Oct 22 2005

References

  • A. J. C. Cunningham, Quadratic Partitions. Hodgson, London, 1904, p. 1.
  • D. H. Lehmer, Guide to Tables in the Theory of Numbers. Bulletin No. 105, National Research Council, Washington, DC, 1941, p. 55.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    with(numtheory): readlib(issqr):for i from 1 to 300 do p:=ithprime(i): pmod8:=modp(p,8): if p=2 or pmod8=1 or pmod8=7 then for y from 1 do if issqr(p+2*y^2) then printf("%d,",y): break fi od fi od: # Pab Ter, Oct 22 2005
  • Mathematica
    maxPrimePi = 200;
    Reap[Do[If[MatchQ[Mod[p, 8], 1|2|7], rp = Reduce[x > 0 && y > 0 && p == x^2 - 2*y^2, {x, y}, Integers]; If[rp =!= False, xy = {x, y} /. {ToRules[rp /. C[1] -> 1]}; y0 = xy[[All, 2]] // Min // Simplify; Print[{p, xy[[1]]} ]; Sow[y0]]], {p, Prime[Range[maxPrimePi]]}]][[2, 1]] (* Jean-François Alcover, Oct 27 2019 *)

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 22 2005

A084916 Positive numbers of the form k = x^2 - 3*y^2.

Original entry on oeis.org

1, 4, 6, 9, 13, 16, 22, 24, 25, 33, 36, 37, 46, 49, 52, 54, 61, 64, 69, 73, 78, 81, 88, 94, 96, 97, 100, 109, 117, 118, 121, 132, 141, 142, 144, 148, 150, 157, 166, 169, 177, 181, 184, 193, 196, 198, 208, 213, 214, 216, 222, 225, 229, 241, 244, 249, 253, 256
Offset: 1

Views

Author

Roger Cuculière, Jul 14 2003

Keywords

Comments

Equivalently, positive numbers of the form k = x^2 + 2xy - 2y^2. These are equivalent forms, of discriminant 12.
Also numbers representable as x^2 + 4*x*y + y^2 with 0 <= x <= y. - Gheorghe Coserea, Jul 29 2018 [The restriction 0 <= x <= y is not necessary. - Klaus Purath, Feb 05 2023]
From Klaus Purath, Feb 05 2023: (Start)
Also positive numbers of the form x^2 + 2*m*x*y + (m^2 - 3)*y^2. This includes all forms given above so far.
All terms are congruent to {0, 1, 4, 6, 9, 10} modulo 12.
The product of any two terms belongs to the sequence - (empirically secured up to a(k)*a(m) for 2 <= k, m <= 85). Thus it appears that this sequence is closed under multiplication. Perhaps someone can find a proof? (End)

Crossrefs

Cf. A031363, A035251, A243655 (primitive representations).
See A068228 for primes.

Programs

  • Mathematica
    Reap[For[n = 1, n < 300, n++, If[Reduce[n == x^2 - 3*y^2, {x, y}, Integers] =!= False, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Dec 03 2013 *)

Extensions

More terms from Reinhard Zumkeller, Jul 17 2003
Showing 1-10 of 14 results. Next