login
A304917
a(n) = prime(n)^n - primorial(n - 1).
1
1, 7, 119, 2371, 160841, 4824499, 410308643, 16983052531, 1801142961773, 420707010207331, 25408470426711601, 6582951805279545151, 925103094894275494511, 73885357039888240238239, 12063348337737606907045313, 3876269049503627062809380911
OFFSET
1,2
FORMULA
a(n) = A062457(n) - A002110(n-1).
EXAMPLE
a(1) = prime(1)^1 - primorial(0) = 2^1 - 1 = 1.
MAPLE
N:=15:
for X from 1 to N do
Z:=mul(ithprime(i), i=1..(X-1));
Y:=(ithprime(X)^X-Z);
print(Y);
end do:
# Second Maple program
seq(ithprime(k)^k-mul(ithprime(i), i=1..k-1), k=1..15); # Muniru A Asiru, Jul 08 2018
MATHEMATICA
Fold[Append[#1, {#1 - #2, #2} & @@ {Prime[#2]^#2, Prime[#2 - 1] #1[[-1, -1]]}] &, {{1, 1}}, Range[2, 16]][[All, 1]] (* Michael De Vlieger, Jul 19 2018 *)
PROG
(PARI) a(n) = prime(n)^n - factorback(primes(n - 1)) \\ David A. Corneth, May 21 2018
CROSSREFS
Cf. A002110, A062457, A305076 (n such that a(n) is prime).
Sequence in context: A221031 A221323 A268300 * A113667 A357351 A376040
KEYWORD
nonn
AUTHOR
STATUS
approved