OFFSET
0,4
EXAMPLE
a(0) = 0 because there are no lucky numbers between 1 (2^0) and 2 (2^1).
a(3) = 3 because there are 3 lucky numbers (9, 13, 15) between 8 (2^3) and 16 (2^4).
PROG
(SageMath)
def lucky(n):
L=list(range(1, n+1, 2)); j=1
while L[j] <= len(L)-1:
L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
j+=1
return(L)
A000959=lucky(1048576)
def lucky_range(a, b):
lucky = []
for l in A000959:
if l >= b:
return lucky
if l>=a: lucky.append(l)
[ len(lucky_range((2^n)+1, 2^(n+1))) for n in range(19)]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Hauke Löffler, Jul 28 2019
EXTENSIONS
a(19)-a(30) from Giovanni Resta, May 10 2020
a(31)-a(32) from Kevin P. Thompson, Nov 22 2021
STATUS
approved