|
|
A309367
|
|
The number of lucky numbers between two consecutive primes, bounds excluded.
|
|
2
|
|
|
0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 2, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 2, 0, 1, 0, 0, 1, 0, 2, 0, 0, 1, 0, 1, 0, 2, 1, 0, 0, 1, 2, 0, 0, 0, 2, 1, 0, 1, 0, 0, 2, 2, 0, 0, 0, 3, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 1, 0, 1, 0, 2, 0, 0, 0, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,15
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 0 because between the first two primes (2,3) there are no lucky numbers.
a(4) = 1 because between 7 and 1 there is one lucky number (9).
a(15) = 2 because between 47 and 53 there are two lucky numbers (49, 51).
|
|
MAPLE
|
# uses[A000959List]
A309367List := proc(mx) local L, j;
L := convert(A000959List(ithprime(mx)), set):
j := n -> {seq(k, k = [$ithprime(n)+1..ithprime(n+1)-1])}:
seq(nops(j(n) intersect L), n = 1..mx) end:
|
|
PROG
|
def lucky_range(a, b):
return [l for l in lucky(b) if a <= l < b]
P = prime_range(250)
[len(lucky_range(P[i]+1, P[i+1])) for i in range(len(P)-1)]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|