OFFSET
1,2
COMMENTS
There is no solution to k * 64656064322391920 + 1 = 0 (mod 21). - Sean A. Irvine, May 04 2024
EXAMPLE
a(6) = 426, a(7) = 3409 since 3409 = 8*426 + 1 is a multiple of 7.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Module[{k}, If[ Intersection[ Transpose[ FactorInteger[a[n - 1]]] [[1]], Transpose[ FactorInteger[n]] [[1]]] == {}, k = 2; While[ !IntegerQ[(k*a[n - 1] + 1)/n], k++ ]; Return[ k*a[n - 1] + 1], k = 1; While[ !IntegerQ[(k*a[n - 2] + 1)/n], k++ ]; Return[ k*a[n - 2] + 1]]]; Table[ a[n], {n, 1, 23}]
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Amarnath Murthy, Mar 23 2002
EXTENSIONS
More terms from Sascha Kurz, Mar 23 2002
Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002
Incorrect a(21) removed by Sean A. Irvine, May 04 2024
STATUS
approved