login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A178989
a(n) = (k^k + k!) / (k*(k + 1)), where k = prime(n) - 1.
1
1, 1, 14, 1128, 90942080, 57157560576, 67818988957718528, 115047995548743401472, 674758653138775267142795264, 40819609745761407890621234130376982528, 221388314080552960064314183934017536000000, 79870389582370042643423622863118514819531536385179648
OFFSET
1,3
COMMENTS
According to the two theorems (Fermat and Wilson), k + 1 divides(k^k + k!) because k^k == 1 (mod k + 1) and k! == - 1 (mod k + 1) for any prime k + 1.
LINKS
EXAMPLE
a(3) = 14 because prime(3) = 5 => p = 4 => (4^4 + 4!) / 4(4 + 1) = 280/20 = 14.
MAPLE
with(numtheory): for n from 1 to 20 do: p:=ithprime(n):q:=p-1:x:= (q^q + q!)/(q*p):
printf(`%d, `, x): od:
MATHEMATICA
f[n_] := Block[{k = Prime@ n - 1}, (k^k + k!)/(k (k + 1))]; Array[f, 10] (* Robert G. Wilson v, Jan 05 2011 *)
PROG
(PARI) a(n)={my(k=prime(n)-1); (k^k + k!) / (k*(k + 1))} \\ Andrew Howroyd, Apr 13 2021
CROSSREFS
Cf. A000040.
Sequence in context: A282272 A208395 A132504 * A232373 A323181 A206613
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jan 03 2011
EXTENSIONS
Terms a(11) and beyond from Andrew Howroyd, Apr 13 2021
STATUS
approved