Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get a list of lucky numbers
ResourceFunction["LuckyNumbers"][n] gives the lucky numbers less than or equal to n. | |
ResourceFunction["LuckyNumbers"][n,k] gives the lucky numbers less than or equal to n, after iterating the sieving procedure k times. |
Give all the lucky numbers less than 100:
| In[1]:= |
| Out[1]= |
Lucky primes are primes that are also lucky numbers:
| In[2]:= |
| Out[2]= |
The first 300 integers surviving 6 steps of the sieving process:
| In[3]:= |
| Out[3]= | ![]() |
Number of lucky numbers less than a million:
| In[4]:= |
| Out[4]= |
Visualize the sieving procedure for lucky numbers step by step:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Distance between lucky numbers:
| In[6]:= |
| In[7]:= |
| Out[7]= | ![]() |
Highlight lucky numbers in an array of integers:
| In[8]:= |
| Out[8]= | ![]() |
Compare lucky numbers with the prime numbers:
| In[9]:= |
| Out[9]= | ![]() |
Select "twin" lucky numbers (pairs of lucky numbers that differ by 2):
| In[10]:= |
| Out[10]= | ![]() |
Verify a version of the Goldbach conjecture for lucky numbers (an even number is a sum of two lucky numbers) for the first few even numbers:
| In[11]:= |
| Out[11]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License