Thread: Power???
View Single Post
Old 2011-08-29, 18:53   #2
science_man_88's Avatar
"Forget I exist"
Jul 2009

203008 Posts

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

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 ?

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