|
|
A309399
|
|
Number of lucky numbers l between powers of 2, 2^n < l <= 2^(n+1).
|
|
2
|
|
|
0, 1, 1, 3, 3, 6, 12, 21, 38, 71, 123, 234, 427, 791, 1477, 2774, 5222, 9849, 18659, 35412, 67410, 128644, 245959, 471166, 904186, 1738238, 3346542, 6452030, 12455921, 24076458, 46591766, 90258683, 175029533
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
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)
def lucky_range(a, b):
lucky = []
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|