Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168727
Image: ubuntu2004
p=1073137282146338814025297276012340514033392142286643\ 182285946106897867885100815144444489959819534285998417\ 753833519511397207193450879131705172428770801749585396\ 377454681078165004036511715043877217438068707562700109\ 319150934601131782394001492737704925458198054954529649\ 68476117438596882036667823702963803652097 is_prime(p)
True
# What is the size of the group Z_p^\times? d=p-1
# What is the prime factorization of d? F=factor(d) F
2^207 * 3^515
# What is the largest F[-1][0]
3
""" We find all 32-bit primes with 3-smooth totient (aka primes of the form 2^v*3^v+1) (aka Pierpont primes) and collect them in the set S """
# the set S collects all Pierpont primes in our given range. # - initialize S # - loop over all possible values for v # - adjust u according to the range requirements # - test 2^u*3^v+1 for primality # - if yes, add to S; if no, ignore S=[] for v in srange(0,floor(log(2^(1024) - 1,3))): u=ceil(log((2^(1023) - 1)/3^v,2)) p=2^u*3^v+1 if is_prime(p): S=S+[p,u,v] S
[107313728214633881402529727601234051403339214228664318228594610689786788510081514444448995981953428599841775383351951139720719345087913170517242877080174958539637745468107816500403651171504387721743806870756270010931915093460113178239400149273770492545819805495452964968476117438596882036667823702963803652097, 207, 515]
# compute the number of decimal digits floor(log(S[0],10))+1
309