login
A137322
a(n) = k! - A051674(n), where k is the smallest number for which A051674(n) <= k! where A051674(n) = prime(n)^prime(n).
0
2, 93, 1915, 2805257, 1022362697389, 52812321503747, 296760465891270915823, 13532790387670672394876021, 244372391812343146601953447089433, 11196066938065133911754151366849886273516531, 3328707950474207400029638710843582600755265569
OFFSET
1,1
EXAMPLE
a(4) = 10! - prime(4)^prime(4) = 3628800 - 823543 = 2805257.
MATHEMATICA
a[n_] := Module[{p = Prime[n]^Prime[n], k = 1}, While[k! < p, k++]; k! - p]; Array[a, 11] (* Amiram Eldar, Mar 12 2022 *)
PROG
(PARI) f(n) = my(p = prime(n)); p^p;
a(n) = my(k=1, P=f(n)); until(k! >= P, k++); k!-P; \\ Michel Marcus, Mar 12 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Apr 06 2008
EXTENSIONS
Corrected and extended by Michel Marcus, Mar 12 2022
STATUS
approved