A111071 Difference between the product of two consecutive primes and the next prime.
1, 8, 24, 64, 126, 202, 300, 408, 636, 862, 1106, 1474, 1716, 1968, 2432, 3066, 3532, 4016, 4684, 5104, 5684, 6468, 7290, 8532, 9694, 10296, 10912, 11550, 12190, 14220, 16500, 17808, 18894, 20560, 22342, 23544, 25424, 27048, 28712, 30786, 32208
Offset: 1
Keywords
Examples
a(4)= prime(4)*prime(5)-prime(6) = 7*11-13=64.
Crossrefs
Cf. A000040.
Programs
-
Magma
[NthPrime(n)*NthPrime(n+1)-NthPrime(n+2): n in [1..50]]; // Vincenzo Librandi, Jul 18 2015
-
Maple
seq(ithprime(n)*ithprime(n+1)-ithprime(n+2), n=1..50); # Emeric Deutsch, Oct 10 2005
-
Mathematica
f[n_] := Prime[n]Prime[n + 1] - Prime[n + 2]; Table[ f[n], {n, 41}] (* Robert G. Wilson v, Oct 10 2005 *) #[[1]]*#[[2]]-#[[3]]&/@Partition[Prime[Range[50]],3,1] (* Harvey P. Dale, Aug 06 2015 *)
-
PARI
main(size)=my(n);vector(size,n,prime(n)*prime(n+1)-prime(n+2)) /* Anders Hellström, Jul 16 2015 */
Extensions
More terms from Robert G. Wilson v and Emeric Deutsch, Oct 10 2005