Skip to content

pflammarion/prime_age_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Digital Product School: Technical challenge

Prime age calculator. When a user enters their birth year, the next year when their age will be a prime number should be displayed.

For example, the user entered 2011, 2024 is displayed (because he’ll be 13 then).


I based my solution on this theorem:

img.png

So it test all possibilities between 2 and \sqrt + 1 from the today age.

When an age is a prime number the script stops and print the chosen year.


To run the script

python main.py

Result :

Enter your birth year: 2011
The next year when your age will be a prime number is: 2024

About

Digital Product School: Technical challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages