A137321 a(n) = prime(n)^prime(n) - k!, where prime(n) is the n-th prime number, and k is the greatest number for which k! <= prime(n)^prime(n).
2, 3, 2405, 460663, 198133379411, 281952316704253, 776149319714627324177, 1357971253927074149763979, 12038706006108210079811416910567, 2195692826371309917093828766580180926483469, 16546151513256634846850635804959240464844734431, 5052512795965694464228024657195578053165744330410199442517
Offset: 1
Examples
a(3) = prime(3)^prime(3) - 6! = 5^5 - 720 = 3125 - 720 = 2405.
Programs
-
Mathematica
With[{f=Range[60]!},Table[p^p-Max[Select[f,#
-
PARI
a(n) = my(k=1, P=prime(n)^prime(n)); until (k! > P, k++); P - (k-1)!; \\ Michel Marcus, Mar 15 2022
Extensions
Name corrected and more terms from Michel Marcus, Mar 15 2022