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-3 of 3 results.

A033314 Least D in the Pellian x^2 - D*y^2 = 1 for which x has least solution n.

Original entry on oeis.org

3, 2, 15, 6, 35, 12, 7, 5, 11, 30, 143, 42, 195, 14, 255, 18, 323, 10, 399, 110, 483, 33, 23, 39, 27, 182, 87, 210, 899, 60, 1023, 17, 1155, 34, 1295, 38, 1443, 95, 1599, 105, 1763, 462, 215, 506, 235, 138, 47, 96, 51, 26, 2703, 78, 2915, 21, 3135, 203, 3363
Offset: 2

Views

Author

Keywords

Comments

The i-th solution pair V(i) = [x(i), y(i)] to the Pellian x^2 - D*y^2 = 1 for a given least solution x(1) = n may be generated through the recurrence V(i+2) = 2*n*V(i+1) - V(i) taking V(0) = [1, 0] and V(1) = [n, sqrt((n^2-1)/a(n))]. V(i) stands for the numerator and denominator of the 2i-th convergent of the continued fraction expansion of sqrt(D).
Thus setting n = 3, for instance, we have D = a(3) = 2 and V(1) = [3, 2] so that along with V(0) = [1, 0] recurrence V(i+2) = 6*V(i+1) - V(i) generates [A001333(2k), A000129(2k)]. Similarly, setting n = 9 generates [A023039, A060645], respectively the numerator and denominator of the 2i-th convergent of sqrt(a(9)), i.e., sqrt(5). - Lekraj Beedassy, Feb 26 2002

Crossrefs

Programs

  • Mathematica
    squarefreepart[n_] :=
      Times @@ Power @@@ ({#[[1]], Mod[#[[2]], 2]} & /@ FactorInteger[n]);
    pellminx[d_] := Module[{q, p, z}, {q, p} = ContinuedFraction[Sqrt[d]];
      If[OddQ[p // Length], p = Join[p, p]];
      z = FromContinuedFraction[Join[{q}, Drop[p, -1]]]; Numerator[z]]
    NMAX = 60; a = {};
    For[n = 2, n <= NMAX, n++, s = squarefreepart[n^2 - 1];
    sd = s Divisors[Sqrt[(n^2 - 1)/s]]^2;
    t = Sort[Transpose[{sd, pellminx[#] & /@ sd}]];
    AppendTo[a, Select[t, #[[2]] == n &, 1][[1, 1]]]
    ]; a (* Herbert Kociemba, Jun 05 2022 *)

A067872 Least m > 0 for which m*n^2 + 1 is a square.

Original entry on oeis.org

3, 2, 7, 3, 23, 8, 47, 15, 79, 24, 119, 2, 167, 48, 3, 63, 287, 80, 359, 6, 88, 120, 527, 28, 623, 168, 727, 12, 839, 44, 959, 255, 216, 288, 8, 20, 1367, 360, 19, 77, 1679, 22, 1847, 30, 208, 528, 2207, 7, 2399, 624, 128, 42, 2807, 728, 696, 3, 160, 840, 3479, 11
Offset: 1

Views

Author

Lekraj Beedassy, Feb 25 2002

Keywords

Comments

Least m > 0 for which x^2 - m*y^2 = 1 has a solution with y = n.
For n > 1, a(n) <= n^2-2. - Chai Wah Wu, Jan 26 2016
Considering the greatest prime factor (gpf) of terms, two curves are evident. One has gpf ~ n^2 (see a(9949)), the other has gpf ~ n^2/7 (see a(9923)). See the gpf plot link. - Bill McEachen, Apr 13 2025

Examples

			a(4)=3, based on 3*4^2 + 1 = 7^2.
		

Crossrefs

Programs

  • Haskell
    a067872 n = (until ((== 1) . a010052 . (+ 1)) (+ nn) nn) `div` nn
                where nn = n ^ 2
    -- Reinhard Zumkeller, Jun 28 2013
    
  • Mathematica
    a[n_] := For[m=1, True, m++, If[IntegerQ[Sqrt[m*n^2+1]], Return[m]]]; Table[a[n], {n, 100}]
    lm[n_]:=Module[{m=1},While[!IntegerQ[Sqrt[m n^2+1]],m++];m]; Array[lm,60] (* Harvey P. Dale, Feb 24 2013 *)
  • Python
    def A067872(n):
        y, x, n2 = n*(n+2), 2*n+3, n**2
        m, r = divmod(y,n2)
        while r:
            y += x
            x += 2
            m, r = divmod(y,n2)
        return m # Chai Wah Wu, Jan 25 2016

Formula

For n a power of an odd prime, a(n) = n^2 - 2. For n twice a power of an odd prime, a(n) = (n/2)^2 - 1. - T. D. Noe, Sep 13 2007

Extensions

Edited by Dean Hickerson, Mar 19 2002

A033319 Incrementally largest values of minimal y satisfying Pell equation x^2-Dy^2=1.

Original entry on oeis.org

0, 2, 4, 6, 180, 1820, 3588, 9100, 226153980, 15140424455100, 183567298683461940, 9562401173878027020, 42094239791738433660, 1238789998647218582160, 189073995951839020880499780706260
Offset: 1

Views

Author

Keywords

Comments

Records in A033317 (or A002349).

Crossrefs

Programs

  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[Sqrt[m]]; n = Length[Last[cf]]; If[n == 0, Return[{}]]; If[OddQ[n], n = 2 n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}];
    yy = DeleteCases[PellSolve /@ Range[10^5], {}][[All, 2]];
    Reap[Module[{y, record = 0}, Sow[0]; For[i = 1, i <= Length@yy, i++, y = yy[[i]]; If[y > record, record = y; Sow[y]]]]][[2, 1]] (* Jean-François Alcover, Nov 21 2020, after N. J. A. Sloane in A002350 *)
Showing 1-3 of 3 results.