login
A340803
Number of composite numbers between the largest noncomposite number <= prime(n)! and the smallest noncomposite number >= prime(n)!.
1
0, 1, 13, 11, 13, 89, 89, 189, 185, 253, 187, 97, 131, 179, 311, 129, 429, 839, 263, 1607, 373, 527, 509, 305, 539, 617, 819, 1687, 565, 423, 2345, 959, 629, 631, 647, 1093, 835, 1937, 491, 1241, 2171, 1139, 731, 1423, 2011, 1817, 1935, 827, 1247, 911, 2669
OFFSET
1,3
LINKS
FORMULA
a(n) = A340802(A000040(n)).
EXAMPLE
a(2) = 1: 6 because prime(2) = 3; 3! = 6 whose neighbors are noncomposites.
a(3) = 13: 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126.
a(4) = 11: 5040, 5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050.
MAPLE
a:= n-> (f-> max(nextprime(f-1)-prevprime(f+1)-1, 0))(ithprime(n)!):
seq(a(n), n=1..52);
MATHEMATICA
b[n_] := If[n < 3, 0, NextPrime[n!] - NextPrime[n!, -1] - 1];
a[n_] := b[Prime[n]];
Array[a, 52] (* Jean-François Alcover, Jan 29 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 21 2021
STATUS
approved