![]() |
![]() |
#1 | |
Dec 2017
24·3·5 Posts |
![]() Quote:
Here is the code: Code:
import time print('''diep factor method''') while True: start_time = time.time() n = int(input('Enter a prime number: ')) f = ((n) * (pow(2,n-1)*2-1)) diep = (pow(2,n-1)*2-1) def isqrt(c): x = c y = (x + 1) // 2 while y < x: x = y y = (x + c // x) // 2 return x c = (floor(c)) for x in range(1,(isqrt(diep))): if f%((x*n+1)) == 0 : print((x*n+1)) e = int(time.time() - start_time) print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60)) break |
|
![]() |
![]() |
![]() |
#2 |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
25·5·41 Posts |
![]() |
![]() |
![]() |
![]() |
#3 |
Romulan Interpreter
"name field"
Jun 2011
Thailand
17·19·31 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Number Theory and Physics. | jwaltos | Miscellaneous Math | 2 | 2019-08-07 09:54 |
Basic Number Theory 1 & 2 | Nick | Number Theory Discussion Group | 17 | 2017-12-23 20:10 |
Easy number theory. | mfgoode | Puzzles | 2 | 2006-05-30 09:46 |
number theory help | math | Homework Help | 2 | 2004-05-02 18:09 |
A problem of number theory | hyh1048576 | Puzzles | 0 | 2003-09-28 15:35 |