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 A298212 #25 May 11 2023 18:34:57 %S A298212 1,1,2,1,5,2,4,2,2,5,5,2,7,4,10,4,3,2,3,5,4,5,4,2,25,7,6,4,7,10,5,8, %T A298212 10,3,20,2,19,3,14,10,10,4,22,5,10,4,8,4,28,25,6,7,9,6,5,4,6,7,29,10, %U A298212 5,5,4,16,35,10,34,3,4,20,35,2,37,19,50 %N A298212 Smallest n such that A060645(a(n)) = 0 (mod n), i.e., x=A023039(a(n)) and y=A060645(a(n)) is the fundamental solution of the Pell equation x^2 - 5*(n*y)^2 = 1. %C A298212 The fundamental solution of the Pell equation x^2 - 5*(n*y)^2 = 1, is the smallest solution of x^2 - 5*y^2 = 1 satisfying y = 0 (mod n). %D A298212 Michael J. Jacobson, Jr. and Hugh C. Williams, Solving the Pell Equation, Springer, 2009, pages 1-17. %H A298212 A.H.M. Smeets, <a href="/A298212/b298212.txt">Table of n, a(n) for n = 1..20000</a> %H A298212 H. W. Lenstra Jr., <a href="http://www.ams.org/notices/200202/fea-lenstra.pdf">Solving the Pell Equation</a>, Notices of the AMS, Vol.49, No.2, Feb. 2002, pp. 182-192. %F A298212 a(n) <= n. %F A298212 a(A000351(n)) = A000351(n). %F A298212 A023039(a(n)) = A002350(5*n^2). %F A298212 A060645(a(n)) = A002349(5*n^2). %F A298212 if n | m then a(n) | a(m). %F A298212 a(5^m) = 5^m for m>=0. %F A298212 In general: if p is prime and p = 1 (mod 4) then: a(n) = n iff n = p^m, for m>=0. %t A298212 b[n_] := b[n] = Switch[n, 0, 0, 1, 4, _, 18 b[n - 1] - b[n - 2]]; %t A298212 a[n_] := For[k = 1, True, k++, If[Mod[b[k], n] == 0, Return[k]]]; %t A298212 a /@ Range[100] (* _Jean-François Alcover_, Nov 16 2019 *) %o A298212 (Python) %o A298212 xf, yf = 9, 4 %o A298212 x, n = 2*xf, 0 %o A298212 while n < 20000: %o A298212 n = n+1 %o A298212 y1, y0, i = 0, yf, 1 %o A298212 while y0%n != 0: %o A298212 y1, y0, i = y0, x*y0-y1, i+1 %o A298212 print(n, i) %Y A298212 Cf. A298210, A298211. %K A298212 nonn %O A298212 1,3 %A A298212 _A.H.M. Smeets_, Jan 15 2018