Non-Square Positive Integers not Sum of Square and Prime
Non-Square Positive Integers not Sum of Square and Prime 0 58473 326104 303396 2017-11-11T09:49:55Z Barto 3079 "work to do" template wikitext text/x-wiki == Conjecture == The sequence of (strictly) positive integers which are not square and not the sum of a square and a prime is believed to be complete: :$10, 34, 58, 85, 91, 130, 214, 226, 370, 526, 706, 730, 771, 1255, 1351, 1414, 1906, 2986, 3676, 9634, 21679$ {{OEIS|A020495}} == Progress == From Square of n such that 2n-1 is Composite is not Sum of Square and Prime, $n^2$ is the sum of a square and a prime  $2 n - 1$ composite. Hence the question is specifically about non-squares. No prime number is in this sequence, as trivially: :$p = p + 0^2$ and so is the sum of a prime (itself), and $0^2$, which is square. Each non-square composite $n \in \Z$ can be tested by subtracting successive squares less than $n$ and investigating whether a prime can result. In the following, the smallest $m$ such that $n - m^2 = p$ is shown where such a $p$ exists. Otherwise the nonexistence of such a $p$ is demonstrated explicitly. As follows: {{begin-eqn}} {{eqn | l = 4 - 1^2       | r = 3       | c = which is prime }} {{eqn | l = 6 - 1^2       | r = 5       | c = which is prime }} {{eqn | l = 8 - 1^2       | r = 7       | c = which is prime }} {{end-eqn}} $10$ cannot be expressed as $10 = m^2 + p$. Thus $10$ is seen to be in this sequence. {{begin-eqn}} {{eqn | l = 12 - 1^2       | r = 11       | c = which is prime }} {{eqn | l = 14 - 1^2       | r = 13       | c = which is prime }} {{eqn | l = 15 - 2^2       | r = 11       | c = which is prime }} {{eqn | l = 16 - 3^2       | r = 7       | c = which is prime }} {{eqn | l = 18 - 1^2       | r = 17       | c = which is prime }} {{eqn | l = 20 - 1^2       | r = 19       | c = which is prime }} {{eqn | l = 21 - 2^2       | r = 17       | c = which is prime }} {{eqn | l = 22 - 3^2       | r = 13       | c = which is prime }} {{eqn | l = 24 - 1^2       | r = 23       | c = which is prime }} {{eqn | l = 26 - 3^2       | r = 17       | c = which is prime }} {{eqn | l = 27 - 2^2       | r = 23       | c = which is prime }} {{eqn | l = 28 - 3^2       | r = 19       | c = which is prime }} {{eqn | l = 30 - 1^2       | r = 29       | c = which is prime }} {{eqn | l = 32 - 1^2       | r = 31       | c = which is prime }} {{eqn | l = 33 - 2^2       | r = 29       | c = which is prime }} {{end-eqn}} $34$ cannot be expressed as $34 = m^2 + p$. Thus $34$ is seen to be in this sequence. Similarly: $58$ cannot be expressed as $58 = m^2 + p$. Thus $58$ is seen to be in this sequence. This establishes the pattern. The algorithm for determining whether a particular $n$ belongs to this sequence can be defined in pseudocode as follows: <pre> For n := 1, loop indefinitely, incrementing by 1:   Is n prime? If so, continue to the next n   Is n square? If so, continue to the next n   For m := 1, incrementing by 1 until m^2 > n:     Is n - n^2 prime? If so, continue to the next n   Next m   Add n to the sequence Next n </pre> {{wtd|Design (or adoption) of a rigorous pseudocode needs to be done. Alternatively we may seek to stick with our existing technique for implement algorithms, and/or use a flow chart.}} {{finish|Tidy up the algorithm above.  Do we demonstrate an instance of an computer program here?}} == Examples == {{:Non-Square Positive Integers not Sum of Square and Prime/Examples}} == Historical Note == {{:Non-Square Positive Integers not Sum of Square and Prime/Historical Note}}