login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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:
A309367List(87); # Peter Luschny, Mar 27 2020
PROG
(Sage) # uses[lucky from A000959]
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
Sequence in context: A275947 A337976 A125005 * A347709 A122179 A335877
KEYWORD
nonn
AUTHOR
Hauke Löffler, Jul 25 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)