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.
%I A074074 #24 Oct 23 2023 09:55:44 %S A074074 5,21,33,17,105,105,189,33,105,405,333,141,473,57,817,189,325,885,77, %T A074074 1425,1173,1925,1425,2301,101,105,1425,333,777,1785,2525,381,1785,405, %U A074074 141,3393,2261,3813,6045,2717,4389,3129,2093,6765,885,5513,189,6045,197,8085 %N A074074 The numbers D in the set {D :=(2n+1)^2-4m^2, 1<=m<=n} that generate the smallest solution x to x^2 - D*y^2 = 1. %C A074074 Given a discriminant D, the Pell equation x^2-D*y^2=1 has a minimum solution x as tabulated in A033313. We start with a set of candidates D of the form (2*n+1)^2-(2*m)^2, obviously all odd, where m runs through the integers from 1 to n. %C A074074 Whichever D out of this set generates the smallest x in A033313, defines a(n)=D. %H A074074 Ray Chandler, <a href="/A074074/b074074.txt">Table of n, a(n) for n = 1..499</a> %e A074074 For n=4, the candidates are D=77 (m=1, index 69 in A000037), D=65 (m=2, index 57 in A000037), D=45 (m=3, index 39 in A000037) and D=17 (m=4, index 13 in A000037), which produce x = 351, x=129, x=161 and x=33 in that order (apply the offset in A033313 while converting indices from A000037 to find the x). Because 33 is the smallest of these four x, we select the associated D=17 as a(4). %p A074074 A033313 := proc(Dcap) local c,i,fr,nu,de ; if issqr(Dcap) then -1; else c := numtheory[cfrac](sqrt(Dcap)) ; for i from 1 do try fr := numtheory[nthconver](c,i) ; nu := numer(fr) ; de := denom(fr) ; if nu^2-Dcap*de^2=1 then RETURN(nu) ; fi; catch: RETURN(-1) ; end try; od: fi: end: %p A074074 A074074 := proc(n) local Dmin,xmin,Dcap ; Dmin := -1 ; xmin := -1; for m from 1 to n do Dcap := (2*n+1+2*m)*(2*n+1-2*m) ; x := A033313(Dcap) ; if xmin = -1 or (x >0 and x<xmin ) then Dmin := Dcap ; xmin := x ; fi; od: Dmin ; end: %p A074074 seq(A074074(n),n=1..50) ; # _R. J. Mathar_, Sep 21 2009 %t A074074 a[n_] := Module[{dd, sols, x, y}, dd = Table[(2 n + 1)^2 - 4 m^2, {m, 1, n}]; sols = Table[{d, x /. Solve[x > 0 && y > 0 && x^2 - d y^2 == 1, {x, y}, Integers]}, {d, dd}] /. C[1] -> 1 // Select[#, #[[2]] != {}&]&; MinimalBy[sols, #[[2, 1]]&][[1, 1]]]; Array[a,50] (* _Jean-François Alcover_, Oct 23 2023 *) %Y A074074 Cf. A074075 (associated m values), A074076. %K A074074 nonn %O A074074 1,1 %A A074074 _Lekraj Beedassy_, Aug 28 2002 %E A074074 Definition clarified, sequence extended beyond a(7) - _R. J. Mathar_, Sep 21 2009