%I #22 Nov 25 2021 01:12:05
%S 1,1,1,2,7,26,115,614,3866,28339,237017,2227657,23233568,266201749
%N Number of lucky numbers <= n!.
%e a(1) = 1 because there is one lucky number (1) <= 1 (1!).
%e a(3) = 2 because there are two lucky numbers (1, 3) <= 6 (3!).
%o (SageMath)
%o def lucky(n):
%o L=list(range(1, n+1, 2)); j=1
%o while L[j] <= len(L)-1:
%o L=[L[i] for i in range(len(L)) if (i+1)%L[j]!=0]
%o j+=1
%o return(L)
%o A000959=lucky(factorial(10))
%o def lucky_range(a,b):
%o lucky = []
%o for l in A000959:
%o if l >= b:
%o return lucky
%o if l>=a: lucky.append(l)
%o [ len(lucky_range(0,factorial(n)+1)) for n in range(10) ]
%Y Cf. A000959, A003604, A309399, A000142.
%K nonn,hard,more
%O 0,4
%A _Hauke Löffler_, Jul 28 2019
%E a(10)-a(12) from _Giovanni Resta_, May 10 2020
%E a(13) from _Kevin P. Thompson_, Nov 24 2021
|