Qbasicnews.com
August 25, 2019, 11:43:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Challenge  (Read 4958 times)
Meg
Ancient QBer
****
Posts: 483


« on: May 16, 2003, 04:19:02 AM »

prove or disprove this statement, mathematically:

"Every even whole number can be expressed as the sum of two prime numbers."

e.g. 2 = 1 + 1, 4 = 3 + 1, 6 = 3 + 3, 8 = 5 + 3, 10 = 5 + 5, 12 = 7 + 5, etc...

*peace*

Meg.
Logged
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #1 on: May 16, 2003, 12:43:50 PM »

Every even whole number can be expressed as the sum of two prime numbers.

For that you'd have to somehow take the set of all prime numbers P and the set of all even numbers E, then somehow combine the set of all prime numbers P into themselves, where P^2 = P1+P2 for all numbers in the sets P1 and P2. (forming a matrix).

After that, you'd somehow compare P^2 and E and you'd have to prove that all E is in the set of P^2.

This is made a little more difficult by the fact that the set of all prime numbers P and all even numbers E is infinite!

EDIT:
One way to approach this would be to form two equations of two prime number sequences and prove that slope of the area formed by adding the total areas of these equations on an (X, Y) grid is 2 (2, 4, 6) and that the equation formed is also a continuous equation. (IE: no gaps!)

EDIT, Again:
So, to get the two equations would probably be equivalent to finding an equation for prime numbers.
Backing up to what I said somewhere else in this forum about reducible sequences, if the equation for prime numbers is infinite in length (IE it is the sequence itself, and there is no smaller sequence to it) then in fact this can all be proved very easily; it would just take infinite time to do so.

EDIT, Once more:
The definition of a prime number is a number n such that
m = all #s {m < n, m mod n = 0} is equal to {1, n}.

The only 100% reliable way to find a prime number is to go through all m's (or all prime numbers < n, for obvious reasons) for a certain n and then find m mod n = 0 for all these m's (except 1).

There are other ways that will give you an answer very quickly as to whether approximately a number is prime--99.9 percent or higher odds.

But there is simply no way out of it. No way to get anything faster than checking all factors less than n. I don't think anyone has proved this, though. But it is obvious enough.

To get such a method would mean that one could get an equation that is smaller than the entire sequence of primes to solve for primes. (besides the definition itself, wherein could lie the answer??)

So, the question of this thread restated is (I think),
"Is there a method that will find out if a number is prime for 100% certainty, (short of a lookup!!!) faster than computing m mod n for all factors m < n?"
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #2 on: May 17, 2003, 02:42:07 PM »

Code:
CLS
prm = 3
INPUT n
DIM prime(n)
FOR ii = 1 TO 3
prime(ii) = ii
NEXT ii
FOR i = 1 TO n
a = i * 6 - 1
b = i * 6 + 1
IF a <= n THEN
 z = 1
 DO
  z = z + 1
  IF z = a THEN prm = prm + 1: prime(prm) = a: EXIT DO
  IF a / z = INT(a / z) THEN EXIT DO
 LOOP
END IF
IF b <= n THEN
 z = 1
 DO
  z = z + 1
  IF z = b THEN prm = prm + 1: prime(prm) = b: EXIT DO
  IF b / z = INT(b / z) THEN EXIT DO
 LOOP
END IF
NEXT
FOR i = 1 TO prm
p1 = n - prime(i)
 z = 1
 d = 0
 DO
  z = z + 1
  IF z >= p1 THEN d = 1: EXIT DO
  IF p1 / z = INT(p1 / z) THEN EXIT DO
 LOOP


IF d = 1 THEN
 PRINT
 PRINT p1; "+"; prime(i); "="; n
END IF

NEXT i
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #3 on: May 17, 2003, 09:50:41 PM »

222
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #4 on: May 17, 2003, 10:00:52 PM »

What?  :Huh:
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
DrV
Na_th_an
*****
Posts: 1553



WWW
« Reply #5 on: May 17, 2003, 10:07:16 PM »

I believe agamenus means that that is a disproof of the above statement.
Logged
Meg
Ancient QBer
****
Posts: 483


.
« Reply #6 on: May 17, 2003, 10:23:10 PM »

222 = 11 + 211
Logged
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #7 on: May 17, 2003, 10:30:40 PM »

149 + 73 = 222
And 59 + 163
And 179 + 43
And  83 + 139

Enter 222 into my program and it spits out the answer
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #8 on: May 20, 2003, 12:13:36 AM »

oh, i tried to make your program readable. But I changed something.

Sorry.
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Agamemnus
x/ \z
*****
Posts: 3491



« Reply #9 on: May 20, 2003, 12:16:41 AM »

I actually discovered something similar or the exact same as "6+-1", but it was 6 years ago. I was out prime formula hunting. I think I disproved my own formula for many cases afterwards, though.
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
whitetiger0990
__/--\__
*****
Posts: 2964



WWW
« Reply #10 on: May 20, 2003, 09:15:39 AM »

In my program you should see that "6+-1" equals the prime numbers. But i have
Code:
DO
  z = z + 1
  IF z = a THEN prm = prm + 1: prime(prm) = a: EXIT DO
  IF a / z = INT(a / z) THEN EXIT DO
LOOP

To check if it's prime.
Logged


[size=10]Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.[/size]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!