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.
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, 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, 10, 6, 31, 15, 6, 32, 21, 6, 34, 4, 22, 3, 35, 12, 18, 19, 30
Offset: 1
Keywords
References
- Michael J. Jacobson, Jr. and Hugh C. Williams, Solving the Pell Equation, Springer, 2009, pages 1-17.
Links
- A.H.M. Smeets, Table of n, a(n) for n = 1..20000
- H. W. Lenstra Jr., Solving the Pell Equation, Notices of the AMS, Vol.49, No. 2, Feb. 2002, pp. 182-192.
Programs
-
Mathematica
b[n_] := b[n] = Switch[n, 0, 0, 1, 2, _, 6 b[n - 1] - b[n - 2]]; a[n_] := For[k = 1, True, k++, If[Mod[b[k], n] == 0, Return[k]]]; a /@ Range[100] (* Jean-François Alcover, Nov 16 2019 *)
-
Python
xf, yf = 3, 2 x, n = 2*xf, 0 while n < 20000: n = n+1 y1, y0, i = 0, yf, 1 while y0%n != 0: y1, y0, i = y0, x*y0-y1, i+1 print(n, i)
Comments