cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A309396 Number of lucky numbers <= n!.

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