mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2011-08-29, 17:07   #1
JohnFullspeed
 
May 2011
France

16110 Posts
Default Power???

I need to find the first multiple of a prime number > an offset

i/e
Let Offset be 223092870
Let P be 21247
I want N like
Offfset+N = 223 093 500 = 105000 * 12247
223092870 div 21247 = 10499
223093500 -223092870 = 630 = N
I code this but I have a problem when the offset change
I do
N:=P-(offset mod p) Is the problem in the pollynome ?

Thanks
JohnFullspeed is offline   Reply With Quote
Old 2011-08-29, 18:53   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
I need to find the first multiple of a prime number > an offset

i/e
Let Offset be 223092870
Let P be 21247
I want N like
Offfset+N = 223 093 500 = 105000 * 12247
223092870 div 21247 = 10499
Code:
223093500 -223092870 = 630 = N
I code this but I have a problem when the offset change
I do
N:=P-(offset mod p) Is the problem in the pollynome ?

Thanks
1)the bold is a massive arithmetic error ( yes I've checked it, and I'm guessing it's a typo?)
2)the underline is a line I personally don't see the use for
3)the italic is a spelling error
4) really because the line I wrapped in code tags says (Offset+N)-Offset = N

5) I come to: X=Offset+(P-(Offset%P)) working no ?
science_man_88 is offline   Reply With Quote
Old 2011-08-30, 06:33   #3
JohnFullspeed
 
May 2011
France

7×23 Posts
Default Typo

( yes I've checked it, and I'm guessing it's a typo?)

Yes I inverse the two first digir of P

21247 is not 12247!!!!
223092870 div 21247 = 10499
P^10499 < Offset
p^10500 > Offset
N= P^10500- Offset
or
N=P-(offset mod p)
N must be >0 and < Offset)
I restart from 0 and I code verifying the error line by line

Have you an idea how to process the Golback conjecture:
all even value is the sum of two primes numbers??

John
JohnFullspeed is offline   Reply With Quote
Old 2011-08-30, 11:29   #4
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
( yes I've checked it, and I'm guessing it's a typo?)

Yes I inverse the two first digir of P

21247 is not 12247!!!!
223092870 div 21247 = 10499
P^10499 < Offset
p^10500 > Offset
N= P^10500- Offset
or
N=P-(offset mod p)
N must be >0 and < Offset)
I restart from 0 and I code verifying the error line by line

Have you an idea how to process the Golback conjecture:
all even value is the sum of two primes numbers??

John
a code I just made:

Code:
f=[];for(i=1,100,for(j=1,100,f=concat(f,if((prime(i)+prime(j))%2==0,prime(i)+prime(j)))));vecsort(f,,8)
science_man_88 is offline   Reply With Quote
Old 2011-08-30, 15:55   #5
JohnFullspeed
 
May 2011
France

7·23 Posts
Default Find!

The polynome was goof the error was at the line just after.

I make N= N^2 ((an optimization) but it's good only if you begin at one:

Quote:
  1. Create a list of consecutive integers from 2 to n: (2, 3, 4, ..., n).
  2. Initially, let p equal 2, the first prime number.
  3. Starting from p, count up in increments of p and mark each of these numbers greater than p itself in the list. These numbers will be 2p, 3p, 4p, etc.; note that some of them may have already been marked.
  4. Find the first number greater than p in the list that is not marked; let p now equal this number (which is the next prime).
  5. If p is less than n, repeat from step 3. Otherwise, stop.

You can modify

3- Starting from p^2, count up in increments of p and mark each of these numbers greater than p itself in the list. These numbers will be 2p, 3p, 4p, etc.; note that some of them may have already been marked.

not if you make a continue search not a set of continues integers
John
JohnFullspeed is offline   Reply With Quote
Old 2011-08-30, 16:28   #6
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Quote:
Originally Posted by JohnFullspeed View Post
The polynome was goof the error was at the line just after.

I make N= N^2 ((an optimization) but it's good only if you begin at one:




You can modify

3- Starting from p^2, count up in increments of p and mark each of these numbers greater than p itself in the list. These numbers will be 2p, 3p, 4p, etc.; note that some of them may have already been marked.

not if you make a continue search not a set of continues integers
John
not this again you made another thread!

if you are looking to make a code I'll give you the steps but you likely don't want that.
science_man_88 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
More Power!!!! petrw1 Teams 10 2019-10-15 17:36
TDP as power used? CRGreathouse Hardware 9 2016-02-06 18:46
How much power am I really using? petrw1 Lounge 19 2013-12-13 13:00
Power 2 JohnFullspeed Miscellaneous Math 45 2011-07-10 20:13
IBM Power 6 Unregistered Information & Answers 7 2008-08-30 14:36

All times are UTC. The time now is 13:20.

Wed Dec 2 13:20:30 UTC 2020 up 83 days, 10:31, 2 users, load averages: 4.55, 4.50, 4.41

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.