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.

Previous Showing 11-20 of 28 results. Next

A031397 Nonsquarefree n such that Pell equation x^2 - n y^2 = -1 is soluble.

Original entry on oeis.org

50, 125, 250, 325, 338, 425, 845, 925, 1025, 1250, 1325, 1445, 1450, 1525, 1625, 1682, 1825, 1850, 2050, 2125, 2197, 2425, 2725, 2738, 2825, 2873, 2890, 3050, 3125, 3250, 3425, 3625, 3725, 3925, 4250, 4325, 4394, 4625, 4825, 4901, 4913
Offset: 1

Views

Author

Keywords

References

  • Harvey Cohn, Advanced Number Theory, Dover Publications, New York, N.Y. (1980).
  • S Vidhyalakshmi, V Krithika, K Agalya, On The Negative Pell Equation, International Journal of Emerging Technologies in Engineering Research (IJETER), Volume 4, Issue 2, February (2016) www.ijeter.everscience.org,

Crossrefs

Equals {A003814} minus {A003654}, cf. A031396.

Programs

  • Maple
    filter:= t -> not numtheory:-issqrfree(t) and [isolve(x^2 - t*y^2 = -1)]<>[]:
    select(filter, [$1..10000]); # Robert Israel, Jul 10 2018
  • Mathematica
    r[n_] := Reduce[x>0 && y>0 && x^2 - n y^2 == -1, {x, y}, Integers];
    Reap[For[n = 1, n <= 5000, n++, If[!SquareFreeQ[n], If[r[n] =!= False, Print[n]; Sow[n]]]]][[2, 1]] (* Jean-François Alcover, Mar 05 2019 *)

Extensions

Offset changed by Robert Israel, Jul 10 2018

A157757 a(n) = 2809*n^2 - 4618*n + 1898.

Original entry on oeis.org

89, 3898, 13325, 28370, 49033, 75314, 107213, 144730, 187865, 236618, 290989, 350978, 416585, 487810, 564653, 647114, 735193, 828890, 928205, 1033138, 1143689, 1259858, 1381645, 1509050, 1642073, 1780714, 1924973, 2074850
Offset: 1

Views

Author

Vincenzo Librandi, Mar 06 2009

Keywords

Comments

The identity (15780962*n^2-25943924*n+10662963)^2-(2809*n^2-4618*n+1898)*(297754*n-244754)^2=1 can be written as A157759(n)^2-a(n)*A157758(n)^2=1.
From Klaus Purath, Mar 31 2025: (Start)
Numbers k such that k*53^2-1 is a square, and k is the sum of two squares (see FORMULA).
All a(n) = D satisfy the Pell equation (k*x)^2 - D*(53*y)^2 = -1 for any integer n where a(1-n) = A157760(n). The values for k and the solutions x, y can be calculated using the following algorithm: k = sqrt(D*53^2 - 1), x(0) = 1, x(1) = 4*D*53^2 - 1, y(0) = 1, y(1) = 4*D*53^2 - 3. The two recurrences are of the form (4*D*53^2 - 2, -1).
It follows from the above that this sequence and A157760 are subsequences of A031396. (End)

Crossrefs

Subsequence of A031396.

Programs

  • Magma
    I:=[89, 3898, 13325]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]];
    
  • Mathematica
    LinearRecurrence[{3,-3,1},{89,3898,13325},40]
    Table[2809n^2-4618n+1898,{n,40}] (* Harvey P. Dale, Aug 02 2024 *)
  • PARI
    a(n) = 2809*n^2 - 4618*n + 1898;

Formula

a(n) = 3*a(n-1) -3*a(n-2) +a(n-3).
G.f.: x*(-89-3631*x-1898*x^2)/(x-1)^3.
a(n) = (28*n - 23)^2 + (45*n - 37)^2. - Klaus Purath, Mar 31 2025
53^2*a(n) - 1 = (2809*n-2309)^2. - Klaus Purath, Mar 31 2025

A157760 a(n) = 2809*n^2 - 1000*n + 89.

Original entry on oeis.org

1898, 9325, 22370, 41033, 65314, 95213, 130730, 171865, 218618, 270989, 328978, 392585, 461810, 536653, 617114, 703193, 794890, 892205, 995138, 1103689, 1217858, 1337645, 1463050, 1594073, 1730714, 1872973, 2020850, 2174345
Offset: 1

Views

Author

Vincenzo Librandi, Mar 06 2009

Keywords

Comments

The identity (15780962*n^2-5618000*n+500001)^2-(2809*n^2-1000*n+89)*( 297754*n-53000)^2=1 can be written as A157762(n)^2-a(n)*A157761(n)^2=1.

Crossrefs

Subsequence of A031396, see A157757.

Programs

  • Magma
    I:=[1898, 9325, 22370]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..50]];
    
  • Mathematica
    LinearRecurrence[{3,-3,1},{1898,9325,22370},50]
  • PARI
    a(n) = 2809*n^2 - 1000*n + 89;

Formula

G.f.: x*(1898 + 3631*x + 89*x^2)/(1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).

A322781 Numbers of the form p*q where p, q are distinct primes congruent to 1 mod 4 such that Legendre(p/q) = -1.

Original entry on oeis.org

65, 85, 185, 265, 365, 481, 485, 493, 533, 565, 629, 685, 697, 785, 865, 949, 965, 985, 1037, 1073, 1157, 1165, 1189, 1241, 1261, 1285, 1385, 1417, 1465, 1565, 1585, 1649, 1685, 1765, 1769, 1781, 1853, 1865, 1921, 1937, 1985, 2117, 2165, 2173, 2257, 2285, 2509, 2561, 2581, 2785, 2813, 2885, 2929, 2941
Offset: 1

Views

Author

N. J. A. Sloane, Jan 11 2019

Keywords

Comments

If k is a term, the Pell equation x^2 - k*y^2 = -1 has a solution [Dirichlet, Newman (1977)]. This is only a sufficient condition, there are many other solutions, see A031396.

Crossrefs

Programs

  • PARI
    isok(n) = my (f=factor(n)); omega(f)==2 && bigomega(f)==2 && f[1,1]%4==1 && f[2,1]%4==1 && kronecker(f[1,1], f[2,1])==-1 \\ Rémy Sigrist, Jan 11 2019
    
  • Python
    from sympy.ntheory import legendre_symbol, factorint
    A322781_list, k = [], 1
    while len(A322781_list) < 10000:
        fk, fv = zip(*list(factorint(4*k+1).items()))
        if sum(fv) == len(fk) == 2 and fk[0] % 4 == fk[1] % 4 == 1 and legendre_symbol(fk[0],fk[1]) == -1:
                A322781_list.append(4*k+1)
        k += 1 # Chai Wah Wu, Jan 11 2019

A323271 Numbers of the form p*q*r where p, q, r are distinct primes congruent to 1 mod 4 such that Legendre(p/q) = Legendre(p/r) = Legendre(q/r) = -1.

Original entry on oeis.org

2405, 3145, 4745, 6205, 6305, 8245, 8905, 9605, 12545, 12805, 14705, 16405, 16745, 17945, 18241, 19045, 19345, 19805, 20213, 20605, 20905, 22945, 23545, 25805, 26605, 26945, 28645, 29705, 30073, 33745, 35705, 35989, 36205, 36305, 37505, 38369, 38545
Offset: 1

Views

Author

N. J. A. Sloane, Jan 11 2019

Keywords

Comments

If k is a term, the Pell equation x^2 - k*y^2 = -1 has a solution [Dirichlet, Newman (1977)]. This is only a sufficient condition, there are many other solutions, see A031396.

Crossrefs

Programs

  • Python
    from sympy.ntheory import legendre_symbol, factorint
    A323271_list, k = [], 1
    while len(A323271_list) < 10000:
        fk, fv = zip(*list(factorint(4*k+1).items()))
        if sum(fv) == len(fk) == 3 and fk[0] % 4 == fk[1] % 4 == fk[2] % 4 == 1 and legendre_symbol(fk[0],fk[1]) == legendre_symbol(fk[0],fk[2]) == legendre_symbol(fk[1],fk[2]) == -1:
                A323271_list.append(4*k+1)
        k += 1 # Chai Wah Wu, Jan 11 2019

A323272 Numbers of the form p_1*p_2*p_3*...*p_r where r is 2 or an odd number > 2, and the p_i are distinct primes congruent to 1 mod 4 such that Legendre(p_i/p_j) = -1 for all i != j.

Original entry on oeis.org

65, 85, 185, 265, 365, 481, 485, 493, 533, 565, 629, 685, 697, 785, 865, 949, 965, 985, 1037, 1073, 1157, 1165, 1189, 1241, 1261, 1285, 1385, 1417, 1465, 1565, 1585, 1649, 1685, 1765, 1769, 1781, 1853, 1865, 1921, 1937, 1985, 2117, 2165, 2173
Offset: 1

Views

Author

N. J. A. Sloane, Jan 11 2019

Keywords

Comments

If k is a term, the Pell equation x^2 - k*y^2 = -1 has a solution [Dirichlet, Newman (1977)]. This is only a sufficient condition, there are many other solutions, see A031396.

Crossrefs

Cf. A002144, A031396. Includes the union of A322781 and A323271.

A062769 Smallest number m such that the continued fraction expansion of sqrt(m) has period 2n + 1.

Original entry on oeis.org

2, 41, 13, 58, 106, 61, 193, 109, 157, 337, 181, 586, 457, 949, 821, 601, 613, 1061, 421, 541, 1117, 1153, 1249, 1069, 1021, 1201, 1669, 2381, 1453, 2137, 2053, 1801, 2293, 1381, 1549, 3733, 3541, 3217, 5857, 1621, 3169, 4657, 2689, 3049, 2389, 4057, 4549
Offset: 0

Views

Author

Lekraj Beedassy, Jul 17 2001

Keywords

Comments

If the continued fraction for sqrt(N) has period (2k + 1) and k-th convergent P(k)/Q(k) [taking P(-1)=1; Q(-1)=0 where necessary], then the i-th positive solution V(i) = [x(i),y(i)] to the Pell equation x^2 - N*y^2 = 1 satisfies the recurrence V(i+2) = 2*A*V(i+1) - V(i) starting with V(0)=(1,0); V(1) = (A,B) where A = 2*S^2 + 1; B = 2*S*T and S = P(k)*Q(k) + P(k-1)*Q(k-1); T = Q(k)^2 + Q(k-1)^2.

Examples

			For n = 2, 2n+1 = 5. a(2) = 13 and we indeed have sqrt(13) = [3; 1, 1, 1, 1, 6] with period 5, the first one in the sequence sqrt(29) = [5; 2, 1, 1, 2, 10], sqrt(53) = [7; 3, 1, 1, 3, 14], sqrt(74) = [8; 1, 1, 1, 1, 16], sqrt(85) = [9; 4, 1, 1, 4, 18], sqrt(89) = [9; 2, 3, 3, 2, 18], ...
		

Crossrefs

Programs

  • Mathematica
    nn = 50; t = Table[0, {nn}]; n = 1; found = 0; While[found < nn, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && (len + 1)/2 <= nn && t[[(len + 1)/2]] == 0, t[[(len + 1)/2]] = n; found++]]]; t (* T. D. Noe, Apr 04 2014 *)

Extensions

More terms from Naohiro Nomoto, Jan 01 2002

A157110 a(n) = 1681*n^2 - 2606*n + 1010.

Original entry on oeis.org

85, 2522, 8321, 17482, 30005, 45890, 65137, 87746, 113717, 143050, 175745, 211802, 251221, 294002, 340145, 389650, 442517, 498746, 558337, 621290, 687605, 757282, 830321, 906722, 986485, 1069610, 1156097, 1245946, 1339157, 1435730, 1535665
Offset: 1

Views

Author

Vincenzo Librandi, Feb 23 2009

Keywords

Comments

The identity (5651522*n^2 - 8761372*n + 3395619)^2 - (1681*n^2 - 2606*n + 1010)*(137842*n - 106846)^2 = 1 can be written as A157112(n)^2 - a(n)*A157111(n)^2 = 1. - Vincenzo Librandi, Jan 25 2012
The continued fraction expansion of sqrt(a(n)) is [41n-32; {4, 1, 1, 4, 82n-64}]. - Magus K. Chu, Oct 03 2022
From Klaus Purath, Apr 18 2025: (Start)
a(n)*41^2-1 is a square, and a(n) is the sum of two squares (see FORMULA). There are no squares in this sequence. The odd prime factors of these terms are always of the form 4*k + 1.
All a(n) = D satisfy the Pell equation (k*x)^2 - D*(41*y)^2 = -1 for any integer n where a(1-n) = A157010(n). The values for k and the solutions x, y can be calculated using the following algorithm: k = sqrt(D*41^2 - 1), x(0) = 1, x(1) = 4*D*41^2 - 1, y(0) = 1, y(1) = 4*D*41^2 - 3. The two recurrences are of the form (4*D*41^2 - 2, -1).
It follows from the above that the terms of this sequence and of A157010 belong to A031396. (End)

Crossrefs

Programs

  • Magma
    I:=[85, 2522, 8321]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jan 25 2012
    
  • Mathematica
    LinearRecurrence[{3,-3,1},{85,2522,8321},40] (* Vincenzo Librandi, Jan 25 2012 *)
    Table[1681*n^2-2606*n+1010,{n,40}] (* Harvey P. Dale, Nov 24 2024 *)
  • PARI
    for(n=1, 22, print1(1681*n^2 - 2606*n + 1010", ")); \\ Vincenzo Librandi, Jan 25 2012

Formula

a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Vincenzo Librandi, Jan 25 2012
G.f.: x*(-85 - 2267*x - 1010*x^2)/(x-1)^3. - Vincenzo Librandi, Jan 25 2012
From Klaus Purath, Apr 18 2025: (Start)
a(n) = (9*n - 7)^2 + (40*n - 31)^2 for any integer n.
1681*a(n) - 1 = (1681*n - 1303)^2 for any integer n. (End)

A202155 x-values in the solution to x^2 - 13*y^2 = -1.

Original entry on oeis.org

18, 23382, 30349818, 39394040382, 51133434066018, 66371158023650982, 86149711981264908618, 111822259780523827735182, 145145207045407947135357618, 188398366922679734857866452982, 244540935120431250437563520613018, 317413945387952840388222591889244382
Offset: 1

Views

Author

Bruno Berselli, Dec 15 2011

Keywords

Comments

The corresponding values of y of this Pell equation are in A202156.

References

  • A. H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, Dover (New York), 1966, p. 264.

Crossrefs

Programs

  • Magma
    m:=13; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(18*x*(1+x)/(1-1298*x+x^2)));
    
  • Mathematica
    LinearRecurrence[{1298, -1}, {18, 23382}, 12]
  • Maxima
    makelist(expand(((18+5*sqrt(13))^(2*n-1)+(18-5*sqrt(13))^(2*n-1))/2), n, 1, 12);

Formula

G.f.: 18*x*(1+x)/(1-1298*x+x^2).
a(n) = -a(-n+1) = (r^(2n-1)-1/r^(2n-1))/2, where r=18+5*sqrt(13).

A202156 y-values in the solution to x^2 - 13*y^2 = -1.

Original entry on oeis.org

5, 6485, 8417525, 10925940965, 14181862955045, 18408047189707445, 23893631070377308565, 31013914721302556809925, 40256037414619648361974085, 52252305550261582271285552405, 67823452348202119168480285047605, 88034788895660800419105138706238885
Offset: 1

Views

Author

Bruno Berselli, Dec 15 2011

Keywords

Comments

The corresponding values of x of this Pell equation are in A202155.

References

  • A. H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, Dover Publications (New York), 1966, p. 264.

Crossrefs

Programs

  • Magma
    m:=13; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(5*x*(1-x)/(1-1298*x+x^2)));
    
  • Mathematica
    LinearRecurrence[{1298, -1}, {5, 6485}, 12]
  • Maxima
    makelist(expand(((18+5*sqrt(13))^(2*n-1)-(18-5*sqrt(13))^(2*n-1))/(2*sqrt(13))), n, 1, 12);

Formula

G.f.: 5*x*(1-x)/(1-1298*x+x^2).
a(n) = a(-n+1) = 5*(r^(2n-1)+1/r^(2n-1))/(r+1/r), where r=18+5*sqrt(13).
a(n) = A006191(6*n - 3). - Michael Somos, Feb 24 2023
Previous Showing 11-20 of 28 results. Next