OFFSET
1,2
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
KEYWORD
nonn
AUTHOR
David James Sycamore, May 20 2018
STATUS
approved