mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2019-11-15, 19:59   #1
Kube Prims
 
"Hans-Peter Kuberna"
Oct 2019
Germany

816 Posts
Default 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
Click image for larger version

Name:	MersenneColumns16112019v4Bild0.jpg
Views:	42
Size:	292.8 KB
ID:	21319   Click image for larger version

Name:	MersenneColumns16112019v4Bild1.jpg
Views:	63
Size:	425.7 KB
ID:	21320  

Last fiddled with by VBCurtis on 2019-11-15 at 22:03 Reason: added code tags
Kube Prims is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Mersenne Software For Test Mersenne Prime Numbers On Android thorken Software 66 2019-01-13 21:08
chess positions: how many legal ones are there ? science_man_88 Chess 266 2012-11-23 18:21
Help finding this book? "Édouard Lucas and prim... Damian Math 1 2011-04-20 16:34
6 digit numbers and the mersenne numbers henryzz Math 2 2008-04-29 02:05
LLT numbers, linkd with Mersenne and Fermat numbers T.Rex Math 4 2005-05-07 08:25

All times are UTC. The time now is 03:39.

Tue Nov 24 03:39:53 UTC 2020 up 75 days, 50 mins, 4 users, load averages: 1.78, 1.58, 1.64

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.