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 A298210 #37 May 11 2023 18:14:19 %S A298210 1,1,2,2,3,2,3,4,6,3,6,2,7,3,6,8,4,6,10,6,6,6,11,4,15,7,18,6,5,6,15, %T A298210 16,6,4,3,6,19,10,14,12,5,6,22,6,6,11,23,8,21,15,4,14,27,18,6,12,10,5, %U A298210 10,6,31,15,6,32,21,6,34,4,22,3,35,12,18,19,30 %N A298210 Smallest n such that A001542(a(n)) == 0 (mod n), i.e., x=A001541(a(n)) and y=A001542(a(n)) is the fundamental solution of the Pell equation x^2 - 2*(n*y)^2 = 1. %C A298210 The fundamental solution of the Pell equation x^2 - 2*(n*y)^2 = 1, is the smallest solution of x^2 - 2*y^2 = 1 satisfying y == 0 (mod n). %C A298210 If n is prime (i.e., n in A000040) then a(n) divides (n - Legendre symbol (n/2)); the Legendre symbol (n/2), or more general Kronecker symbol (n/2) is A091337(n). - _A.H.M. Smeets_, Jan 23 2018 %C A298210 From _A.H.M. Smeets_, Jan 23 2018: (Start) %C A298210 Stronger, but conjectured: %C A298210 If n is prime (i.e., in A000040) and n in {2,3,5,7,11,13,19,23} (mod 24) then (n - Legendre symbol (n/2)) / a(n) == 2 (mod 4). %C A298210 If n is a safe prime (i.e., in A005385) and n in {7,23} (mod 24) then (n - Legendre symbol (n/2)) / a(n) = 2, i.e., a(n) is a Sophie Germain prime (A005384). %C A298210 If n is prime (i.e., in A000040) and n in {1,17} (mod 24) then (n - Legendre symbol (n/2)) / a(n) == 0 (mod 4). (End) %D A298210 Michael J. Jacobson, Jr. and Hugh C. Williams, Solving the Pell Equation, Springer, 2009, pages 1-17. %H A298210 A.H.M. Smeets, <a href="/A298210/b298210.txt">Table of n, a(n) for n = 1..20000</a> %H A298210 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 A298210 a(n) <= A000010(n) < n. - _A.H.M. Smeets_, Jan 23 2018 %F A298210 A001541(a(n)) = A002350(2*n^2). %F A298210 A001542(a(n)) = A002349(2*n^2). %F A298210 if n | m then a(n) | a(m). %F A298210 a(2^(m+1)) = 2^m for m>=0. %t A298210 b[n_] := b[n] = Switch[n, 0, 0, 1, 2, _, 6 b[n - 1] - b[n - 2]]; %t A298210 a[n_] := For[k = 1, True, k++, If[Mod[b[k], n] == 0, Return[k]]]; %t A298210 a /@ Range[100] (* _Jean-François Alcover_, Nov 16 2019 *) %o A298210 (Python) %o A298210 xf, yf = 3, 2 %o A298210 x, n = 2*xf, 0 %o A298210 while n < 20000: %o A298210 n = n+1 %o A298210 y1, y0, i = 0, yf, 1 %o A298210 while y0%n != 0: %o A298210 y1, y0, i = y0, x*y0-y1, i+1 %o A298210 print(n, i) %Y A298210 Cf. A298211, A298212. %K A298210 nonn %O A298210 1,3 %A A298210 _A.H.M. Smeets_, Jan 15 2018