As a practice applciation, I am trying to write a prime number calculator that would be able to given a number, for example "124981242424", determine the nearest prime number and give me the ten next prime numbers in increasing order.
I was trying to determine how to calculate primes and to my understanding a prime number is determined to be prime if it is not divisible by any previous prime numbers.
Therefore: 2,3,5,7,11... To calculate prime, we must divide all following numbers by the previous primes to determine the next prime, which in this case is 13.
This is the only method that I could think of that could be programmed.
Are there any other ways? Because this means my program would need to go back and calculate all the primes from the beginning to output the sequence that I want.