OFFSET
1,2
COMMENTS
Terms from Robert G. Wilson v.
There is no solution to k * 10072945105649045737853905 == -1 (mod 20^2) hence the sequence is finite. - Sean A. Irvine, Mar 28 2024
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{k = 1}, While[ !IntegerQ[(k*a[n - 1] + 1)/n^2], k++ ]; Return[k*a[n - 1] + 1]]; Table[a[n], {n, 1, 19}] (* Robert G. Wilson v *)
nxt[{n_, a_}]:=Module[{n2=(n+1)^2, k=1}, While[!Divisible[k*a+1, n2], k++]; {n+1, k*a+1}]; NestList[nxt, {1, 1}, 17][[All, 2]] (* Harvey P. Dale, Nov 10 2022 *)
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Amarnath Murthy, Apr 02 2002
EXTENSIONS
Offset corrected and sequence completed by Sean A. Irvine, Mar 28 2024
STATUS
approved