OFFSET
1,4
EXAMPLE
a(5) = 12, 10! concatenated with 12 = 362880012 == 0 (mod prime(5)).
MAPLE
c0:=proc(x, y) local s: s:=proc(m) nops(convert(m, base, 10)) end: if y=0 then 10*x else x*10^s(y)+y: fi end: a:=proc(n) local p: p:=proc(k) if c0((ithprime(n)-1)!, k) mod ithprime(n) = 0 then k else fi end: [seq(p(k), k=0..400)][1] end: seq(a(n), n=1..75); # c0 yields the concatenation of two numbers # Emeric Deutsch, Aug 05 2005
MATHEMATICA
Do[p = Prime[n]; k = 0; s = ToString[(p-1)! ]; While[Mod[ToExpression[s <> ToString[k]], p] > 0, k++ ]; Print[k], {n, 1, 50}] (* Ryan Propper, Aug 05 2005 *)
lnk[n_]:=Module[{p=Prime[n], c, k=0}, c=(Prime[n]-1)!; While[Mod[ c*10^ IntegerLength[ k]+k, p]!=0, k++]; k]; Join[{0, 1, 0}, Array[lnk, 60, 4]] (* Harvey P. Dale, Dec 27 2019 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Aug 01 2005
EXTENSIONS
More terms from Ryan Propper and Emeric Deutsch, Aug 05 2005
STATUS
approved