I'm testing a theory of brute forcing $2^k+3$.
I've tried to test $(2^k)+3$ where $k=84$ but my computer just takes too long... Java takes too long too..
It's pretty stupid to assume 83 tests makes a perfect case, but I'll take it as a halfway decent case.
My Brute Force -vs- Square Root Brute Force
- $(2^k)+3$ where $k=55$ as prime in 4.7 seconds vs 7.1 seconds.
- $(2^k)+3$ where $k=64$ as NOT PRIME in 19 seconds vs 29 seconds
- $(2^k)+3$ where $k=67$ as prime in 63 seconds vs 899 seconds.
I'm no expert and I'm sure there are much better ways than brute forcing...
I just found it weird (despite being useless?) and I am not capable of mathematically proving/testing why it works so far as I am not a mathematician - and I am curious if it will continue to work.
For numbers of the form $2^k+3$:
- Find $2^k+3$.
- Take the square root of step 1.
- Take the square root of step 2.
- Times the result of step 3 by the square of k.
- Times the result of step 4 by 3.
- Mod by all numbers underneath step 5.
- If no result of step 6 equals 0, the number is prime.
Further optimization can include testing step 6 by numbers of form 6k+-1.