mersenneforum.org The Possible Positions of Mersenne Prim Numbers.
 Register FAQ Search Today's Posts Mark Forums Read

 2019-11-15, 19:59 #1 Kube Prims   "Hans-Peter Kuberna" Oct 2019 Germany 23 Posts The Possible Positions of Mersenne Prim Numbers. # The Possible Positions of Mersenne Prim Numbers. # The Mersenne Prime Numbers and the Column 0 and 1. # Die möglichen Positionen von Mersenne-Primzahlen. # Die Mersenne-Primzahlen und die Spalten 0 und 1. # MersenneColumns16112019v4.txt # (c) Hans-Peter Kuberna 2019 # hans-peter@kuberna.de # SageMath 8.1 Code: print print "MersenneColumns16112019v4.txt" print " (c) Hans-Peter Kuberna 2019" print " hans-peter@kuberna.de" print "SageMath 8.1" p = [2,3,5,7,13,17,19,31,61,89,107,127] # 0..11 # SageMath FxIndexKubePrim to FxZahl def FxKubePrimZahl(FxIndexKubePrim): FxKubePrimSpalten = [1,7,11,13,17,19,23,29] FxZeile=FxIndexKubePrim//8 FxSpalte=FxIndexKubePrim-(FxZeile*8) FxZahlKubePrim=(FxZeile*30)+FxKubePrimSpalten[FxSpalte] return FxZeile,FxSpalte,FxZahlKubePrim #return FxZahlKubePrim FxKubePrimArray=[0,0,0] KubePrim=FxKubePrimArray[2] # FxKubePrimArray=FxKubePrimZahl(FxIndexKubePrim) def FxZahlZuIndexKubePrim(FxZahlKubePrim): FxKubePrimSpalten = [1,7,11,13,17,19,23,29] FxKubePrimSpaltenArray = [0..29] for IndexKubePrimSpalten in range (0,29): FxKubePrimSpaltenArray[IndexKubePrimSpalten]=-1 for IndexKubePrimSpalten in range (0,8): FxKubePrimSpalte=FxKubePrimSpalten[IndexKubePrimSpalten] FxKubePrimSpaltenArray[FxKubePrimSpalte]=IndexKubePrimSpalten FxIndexKubePrimInt30=FxZahlKubePrim//30 FxIndexKubePrimInt30m30=FxIndexKubePrimInt30*30 FxZahlKubePrimRest=FxZahlKubePrim-FxIndexKubePrimInt30m30 if FxKubePrimSpaltenArray[FxZahlKubePrimRest]==-1: FxIndexKubePrim=-1 else: FxIndexKubePrim=FxIndexKubePrimInt30*8 FxKubePrimSpalte=FxKubePrimSpaltenArray[FxZahlKubePrimRest] FxIndexKubePrim=FxIndexKubePrim+FxKubePrimSpalte return FxIndexKubePrim # -1 => Fehler # ZahlZuIndexKubePrim=FxZahlZuIndexKubePrim(KubePrim) print "--------------------------------------------", print "--------------------------------------------" SchleifeIndexMin=0 ; SchleifeIndexMax=8*4+1 SchleifeIndex=SchleifeIndexMin while SchleifeIndex<=SchleifeIndexMax: Exponent2=SchleifeIndex FxKubePrimArray=FxKubePrimZahl(SchleifeIndex) Exponent2=FxKubePrimArray[2] #print('%21s %3s' % ("Exponent 2 =",Exponent2)), print('%21s' % ("Exponent 2 = ")), #print('%4s %3s' % ("Exponent2 = ")), print('%11s' % Exponent2), if is_prime(Exponent2): print " prime ", else: print " not prime ", print('%18s %5s' % ("Berechnung Nr. ",SchleifeIndex)) MersennePrim=(2**Exponent2)-1 print('%21s %22s' % ("Mersenne Prim =","(2**Exponent2)-1")) print('%21s %60s' % ("Mersenne Prim =",MersennePrim)), if is_prime(MersennePrim): print " prime" else: print " not prime" print IndexMersenneKubePrim=FxZahlZuIndexKubePrim(MersennePrim) print('%21s %60s' % ("IndexKubePrim =",IndexMersenneKubePrim)), if is_prime(IndexMersenneKubePrim): print " prime" else: print " not prime" FxKubePrimArray=FxKubePrimZahl(IndexMersenneKubePrim) KubePrim1=FxKubePrimArray[2] ZahlZuIndexKubePrim=FxZahlZuIndexKubePrim(KubePrim1) print('%21s %60s' % ("Kube Prim 1 =",KubePrim1)), if is_prime(KubePrim1): print " prime" else: print " not prime" KubePrimSpalte1=FxKubePrimArray[1] print('%21s %60s' % ("Kube Prim Spalte 1 =",KubePrimSpalte1)), if MersennePrim==KubePrim1: print " Mersenne ? True" else: print " Mersenne ? False" print IndexMersenneKubePrim=FxZahlZuIndexKubePrim(MersennePrim) IndexMersenneKubePrimPlus1=IndexMersenneKubePrim+1 print('%21s %60s' % ("IndexKubePrim+1 =",IndexMersenneKubePrimPlus1)), if is_prime(IndexMersenneKubePrimPlus1): print " prime" else: print " not prime" FxKubePrimArray=FxKubePrimZahl(IndexMersenneKubePrimPlus1) KubePrim2=FxKubePrimArray[2] ZahlZuIndexKubePrim=FxZahlZuIndexKubePrim(KubePrim2) print('%21s %60s' % ("Kube Prim 2 =",KubePrim2)), if is_prime(KubePrim2): print " prime" else: print " not prime" KubePrimSpalte2=FxKubePrimArray[1] print('%21s %60s' % ("Kube Prim Spalte 2 =",KubePrimSpalte2)), if MersennePrim==KubePrim2: print " Mersenne ? True" else: print " Mersenne ? False" SchleifeIndex=SchleifeIndex+1 print "--------------------------------------------", print "--------------------------------------------" print Attached Thumbnails     Last fiddled with by VBCurtis on 2019-11-15 at 22:03 Reason: added code tags

 Similar Threads Thread Thread Starter Forum Replies Last Post thorken Software 66 2019-01-13 21:08 science_man_88 Chess 266 2012-11-23 18:21 Damian Math 1 2011-04-20 16:34 henryzz Math 2 2008-04-29 02:05 T.Rex Math 4 2005-05-07 08:25

All times are UTC. The time now is 01:57.

Mon Jan 30 01:57:56 UTC 2023 up 164 days, 23:26, 0 users, load averages: 1.01, 1.00, 1.08