A309396 Number of lucky numbers <= n!.
1, 1, 1, 2, 7, 26, 115, 614, 3866, 28339, 237017, 2227657, 23233568, 266201749
Offset: 0
Examples
a(1) = 1 because there is one lucky number (1) <= 1 (1!). a(3) = 2 because there are two lucky numbers (1, 3) <= 6 (3!).
Programs
-
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(factorial(10)) def lucky_range(a,b): lucky = [] for l in A000959: if l >= b: return lucky if l>=a: lucky.append(l) [ len(lucky_range(0,factorial(n)+1)) for n in range(10) ]
Extensions
a(10)-a(12) from Giovanni Resta, May 10 2020
a(13) from Kevin P. Thompson, Nov 24 2021