Are You Lucky Enough To Pick A Prime Number Every Time?

Read Euler, Read Euler. The master of us all. — Pierre−Simon Laplace

Are You Lucky Enough To Pick A Prime Number Every Time?

Read Euler, Read Euler. The master of us all. — Pierre−Simon Laplace

How lucky are you? Well, basically, some people are more lucky than others, and it is the way that life goes. Many of us rely on lucky numbers, such as 7, 3 and 11, and see 13 are unlucky. But, Leonhard Euler found that a polynomial of:

k² + k -n

had six lucky numbers of 2, 3, 5, 11, 17 and 41 that produced a sequence of prime numbers [here]. A simple Python program to produce these is [here]:


import sys
n=41
if (len(sys.argv)>1):
n=int(sys.argv[1])

print(f"Trying lucky number of {n} for k^2-k+{n}\n")
for k in range(1, n):
prime=k*k-k+n
print(prime, end=' ')

And for an input of 41, we get a sequence of 41 prime numbers [here]:

Trying lucky number of 41 for k^2-k+41

41 43 47 53 61 71 83 97 113 131 151 173 197 223 251 281 313 347 383 421 461
503 547 593 641 691 743 797 853 911 971 1033 1097 1163 1231 1301 1373 1447
1523 1601

Find out more about the magic of prime numbers here:

https://asecuritysite.com/primes