User:A()/A()'s Square Prime conjecture

From Esolang
Jump to navigation Jump to search

User:A()’s Square Prime conjecture states that the following is true:

  1. There are infinite square numbers
  2. There are infinite prime numbers
  3. For any square number n where n > 4, there must at least one set of primes that when summed together equal n
  4. Said set of primes cannot have duplicates (i.e {2,2,3} is invalid)
  • 9 -> {2,7}
  • 16 -> {3, 13}
  • 25 -> {5, 7, 13}
  • 36 -> {13, 23}
  • 49 -> {7, 11, 31}

… etc

How to find prime candidates

  1. Take a square integer X
  2. Take a prime P which is the biggest prime smaller than X
  3. Take the difference of X and P
  • If the difference of X and P is prime, stop
  • Else, substitute X for the difference and repeat steps 2-3
  • If the difference is greater than 4, go back to step 2 and choose a smaller prime number P

Other Strategies

Idiot Strat

Like the strategy above but you can choose any prime number below X. This strategy's weak because if you have a number like 100 and you choose 23 for your prime number, the difference is going to be too large.

Spiral Strat

  1. Take a square number X
  2. Subtract a prime number P that equates to the next smallest square (i.e n2 - P = (n - 1)2)
  • If the result is 9, end
  • If the result is the next smallest square that's greater than 4, continue

You use recursion for this strategy. The problem is that this assumes you'll never get a prime occurring twice, which does happen.