Prime number needs

General discussion about calculators, Swiss Micros or otherwise
User avatar
Walter
Posts: 1342
Joined: Tue May 02, 2017 9:13 am
Location: Close to FRA, Germany

Re: Prime number needs

Post by Walter » Sat Mar 21, 2020 10:33 pm

Mark Hardman wrote:
Sat Mar 21, 2020 12:16 am
The most commonly used version of the Mersenne Twister algorithm is based on the Mersenne prime 2^(19937)−1.
I'm afraid this exceeds our range. The greatest integer allowed on the 43S has 999 digits.
DM42 SN: 00041 --- Follower of Platon.

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

User avatar
Jaymos
Posts: 511
Joined: Sun Nov 04, 2018 6:03 pm
Location: Cape Town

Re: Prime number needs

Post by Jaymos » Sat Mar 21, 2020 11:45 pm

295 large primes, generated by custom code using the WP43S's new NextPrime algorithm.

I purposely tried primes below and above the advertised prime range, and found no falsely identified primes.

How I did it: A bit of a cheat as RPN code is still not available. But I wanted a long list of long primes to check Martin's algorithm. The code is similar to future RPN user code, but I hard coded it in C in my WP43C which uses the full WP43S math engine. It does a loop of 59, storing the first seed prime in X-register to R[40], then finding the next prime and storing it into the next register, and so on until register 98. I used the simulator keyboard command to then copy the complete register space to clipboard, and pasted into a text file, which I formatted for a Wolfram Alpha query.

The primes were in 6 groups of consecutive primes. The largest series tested was the 59 primes preceding 3.14 x 10^55.

Wolfram Alpha's check below, all "TRUE".

Code: Select all

{True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True}
The Wolfram Alpha query that I used to check for the 295 primes.

Code: Select all

PrimeQ[List[
  4776913109852041418248056622882493497
, 4776913109852041418248056622882493489
, 4776913109852041418248056622882493479
, 4776913109852041418248056622882493453
, 4776913109852041418248056622882493447
, 4776913109852041418248056622882493443
, 4776913109852041418248056622882493387
, 4776913109852041418248056622882493239
, 4776913109852041418248056622882493161
, 4776913109852041418248056622882493059
, 4776913109852041418248056622882492537
, 4776913109852041418248056622882492511
, 4776913109852041418248056622882492499
, 4776913109852041418248056622882492427
, 4776913109852041418248056622882492393
, 4776913109852041418248056622882492327
, 4776913109852041418248056622882492289
, 4776913109852041418248056622882492117
, 4776913109852041418248056622882492051
, 4776913109852041418248056622882491869
, 4776913109852041418248056622882491817
, 4776913109852041418248056622882491799
, 4776913109852041418248056622882491727
, 4776913109852041418248056622882491679
, 4776913109852041418248056622882491659
, 4776913109852041418248056622882491577
, 4776913109852041418248056622882491551
, 4776913109852041418248056622882491509
, 4776913109852041418248056622882491461
, 4776913109852041418248056622882491433
, 4776913109852041418248056622882491407
, 4776913109852041418248056622882491347
, 4776913109852041418248056622882491133
, 4776913109852041418248056622882491077
, 4776913109852041418248056622882491013
, 4776913109852041418248056622882490941
, 4776913109852041418248056622882490761
, 4776913109852041418248056622882490671
, 4776913109852041418248056622882490627
, 4776913109852041418248056622882490489
, 4776913109852041418248056622882490359
, 4776913109852041418248056622882490311
, 4776913109852041418248056622882490269
, 4776913109852041418248056622882490249
, 4776913109852041418248056622882490177
, 4776913109852041418248056622882490051
, 4776913109852041418248056622882489787
, 4776913109852041418248056622882489781
, 4776913109852041418248056622882489591
, 4776913109852041418248056622882489453
, 4776913109852041418248056622882489373
, 4776913109852041418248056622882489361
, 4776913109852041418248056622882489013
, 4776913109852041418248056622882488907
, 4776913109852041418248056622882488893
, 4776913109852041418248056622882488829
, 4776913109852041418248056622882488683
, 4776913109852041418248056622882488583
, 4776913109852041418248056622882488551
, 100000000000000000002587
, 100000000000000000002383
, 100000000000000000002371
, 100000000000000000002343
, 100000000000000000002337
, 100000000000000000002299
, 100000000000000000002281
, 100000000000000000002227
, 100000000000000000002173
, 100000000000000000002139
, 100000000000000000002133
, 100000000000000000002023
, 100000000000000000002017
, 100000000000000000001971
, 100000000000000000001819
, 100000000000000000001809
, 100000000000000000001789
, 100000000000000000001743
, 100000000000000000001737
, 100000000000000000001653
, 100000000000000000001617
, 100000000000000000001603
, 100000000000000000001561
, 100000000000000000001557
, 100000000000000000001533
, 100000000000000000001527
, 100000000000000000001489
, 100000000000000000001483
, 100000000000000000001447
, 100000000000000000001371
, 100000000000000000001357
, 100000000000000000001303
, 100000000000000000001267
, 100000000000000000001183
, 100000000000000000001131
, 100000000000000000001051
, 100000000000000000001027
, 100000000000000000000999
, 100000000000000000000993
, 100000000000000000000901
, 100000000000000000000883
, 100000000000000000000873
, 100000000000000000000861
, 100000000000000000000843
, 100000000000000000000829
, 100000000000000000000733
, 100000000000000000000693
, 100000000000000000000679
, 100000000000000000000649
, 100000000000000000000547
, 100000000000000000000537
, 100000000000000000000531
, 100000000000000000000483
, 100000000000000000000393
, 100000000000000000000253
, 100000000000000000000249
, 100000000000000000000213
, 100000000000000000000171
, 100000000000000000000157
, 100000000000000000002587
, 100000000000000000002383
, 100000000000000000002371
, 100000000000000000002343
, 100000000000000000002337
, 100000000000000000002299
, 100000000000000000002281
, 100000000000000000002227
, 100000000000000000002173
, 100000000000000000002139
, 100000000000000000002133
, 100000000000000000002023
, 100000000000000000002017
, 100000000000000000001971
, 100000000000000000001819
, 100000000000000000001809
, 100000000000000000001789
, 100000000000000000001743
, 100000000000000000001737
, 100000000000000000001653
, 100000000000000000001617
, 100000000000000000001603
, 100000000000000000001561
, 100000000000000000001557
, 100000000000000000001533
, 100000000000000000001527
, 100000000000000000001489
, 100000000000000000001483
, 100000000000000000001447
, 100000000000000000001371
, 100000000000000000001357
, 100000000000000000001303
, 100000000000000000001267
, 100000000000000000001183
, 100000000000000000001131
, 100000000000000000001051
, 100000000000000000001027
, 100000000000000000000999
, 100000000000000000000993
, 100000000000000000000901
, 100000000000000000000883
, 100000000000000000000873
, 100000000000000000000861
, 100000000000000000000843
, 100000000000000000000829
, 100000000000000000000733
, 100000000000000000000693
, 100000000000000000000679
, 100000000000000000000649
, 100000000000000000000547
, 100000000000000000000537
, 100000000000000000000531
, 100000000000000000000483
, 100000000000000000000393
, 100000000000000000000253
, 100000000000000000000249
, 100000000000000000000213
, 100000000000000000000171
, 100000000000000000000157
, 31415926535897932384626433832795030000000000000000008399
, 31415926535897932384626433832795030000000000000000008331
, 31415926535897932384626433832795030000000000000000008091
, 31415926535897932384626433832795030000000000000000007677
, 31415926535897932384626433832795030000000000000000007559
, 31415926535897932384626433832795030000000000000000007391
, 31415926535897932384626433832795030000000000000000007269
, 31415926535897932384626433832795030000000000000000007169
, 31415926535897932384626433832795030000000000000000007083
, 31415926535897932384626433832795030000000000000000007031
, 31415926535897932384626433832795030000000000000000006927
, 31415926535897932384626433832795030000000000000000006623
, 31415926535897932384626433832795030000000000000000006579
, 31415926535897932384626433832795030000000000000000006437
, 31415926535897932384626433832795030000000000000000006357
, 31415926535897932384626433832795030000000000000000006341
, 31415926535897932384626433832795030000000000000000006243
, 31415926535897932384626433832795030000000000000000006237
, 31415926535897932384626433832795030000000000000000006147
, 31415926535897932384626433832795030000000000000000006111
, 31415926535897932384626433832795030000000000000000005979
, 31415926535897932384626433832795030000000000000000005829
, 31415926535897932384626433832795030000000000000000005727
, 31415926535897932384626433832795030000000000000000005571
, 31415926535897932384626433832795030000000000000000005277
, 31415926535897932384626433832795030000000000000000005159
, 31415926535897932384626433832795030000000000000000005031
, 31415926535897932384626433832795030000000000000000004611
, 31415926535897932384626433832795030000000000000000004473
, 31415926535897932384626433832795030000000000000000004353
, 31415926535897932384626433832795030000000000000000004277
, 31415926535897932384626433832795030000000000000000004193
, 31415926535897932384626433832795030000000000000000004131
, 31415926535897932384626433832795030000000000000000004049
, 31415926535897932384626433832795030000000000000000003861
, 31415926535897932384626433832795030000000000000000003737
, 31415926535897932384626433832795030000000000000000003653
, 31415926535897932384626433832795030000000000000000003639
, 31415926535897932384626433832795030000000000000000003603
, 31415926535897932384626433832795030000000000000000003123
, 31415926535897932384626433832795030000000000000000003027
, 31415926535897932384626433832795030000000000000000002909
, 31415926535897932384626433832795030000000000000000002891
, 31415926535897932384626433832795030000000000000000002523
, 31415926535897932384626433832795030000000000000000002453
, 31415926535897932384626433832795030000000000000000002441
, 31415926535897932384626433832795030000000000000000002427
, 31415926535897932384626433832795030000000000000000002351
, 31415926535897932384626433832795030000000000000000002073
, 31415926535897932384626433832795030000000000000000002019
, 31415926535897932384626433832795030000000000000000001767
, 31415926535897932384626433832795030000000000000000001683
, 31415926535897932384626433832795030000000000000000001583
, 31415926535897932384626433832795030000000000000000001371
, 31415926535897932384626433832795030000000000000000001211
, 31415926535897932384626433832795030000000000000000001197
, 31415926535897932384626433832795030000000000000000001181
, 31415926535897932384626433832795030000000000000000000693
, 31415926535897932384626433832795030000000000000000000363
, 18446744073709554151
, 18446744073709554149
, 18446744073709554121
, 18446744073709553963
, 18446744073709553939
, 18446744073709553869
, 18446744073709553837
, 18446744073709553813
, 18446744073709553809
, 18446744073709553687
, 18446744073709553681
, 18446744073709553653
, 18446744073709553597
, 18446744073709553561
, 18446744073709553543
, 18446744073709553533
, 18446744073709553501
, 18446744073709553447
, 18446744073709553411
, 18446744073709553401
, 18446744073709553291
, 18446744073709553171
, 18446744073709553137
, 18446744073709553099
, 18446744073709553033
, 18446744073709553029
, 18446744073709553023
, 18446744073709552969
, 18446744073709552957
, 18446744073709552901
, 18446744073709552859
, 18446744073709552729
, 18446744073709552697
, 18446744073709552621
, 18446744073709552613
, 18446744073709552597
, 18446744073709552577
, 18446744073709552541
, 18446744073709552501
, 18446744073709552423
, 18446744073709552421
, 18446744073709552373
, 18446744073709552361
, 18446744073709552357
, 18446744073709552333
, 18446744073709552267
, 18446744073709552253
, 18446744073709552213
, 18446744073709552157
, 18446744073709552109
, 18446744073709552009
, 18446744073709551947
, 18446744073709551923
, 18446744073709551757
, 18446744073709551709
, 18446744073709551697
, 18446744073709551667
, 18446744073709551653
, 18446744073709551629
]]
Jaco Mostert
Elec Eng, South Africa
WP34C, HP42S, DM42 for complex math; 35S, 28C, 32Sii, WP34S, EL-506P, EL-W506, PB700; owned FX702P & 11C; used 67 & 85. iOS: 42s (Byron), Free42, WP31S/34S, HCalc.
43S operators right. DM42 sn. 03818.

User avatar
Jaymos
Posts: 511
Joined: Sun Nov 04, 2018 6:03 pm
Location: Cape Town

Re: Prime number needs

Post by Jaymos » Sun Mar 22, 2020 11:29 am

Jaymos wrote:
Sat Mar 21, 2020 11:45 pm
The largest series tested was the 59 primes preceding 3.14 x 10^55.

That was a silly statement. All 59 in fact do NOT precede 3.14 x 10^55, as I used rounding in the sentence. Correctly stated:

The highest primes found and tested were the 59 successive primes from 31 415 926 535 897 932 384 626 433 832 795 030 000 000 000 000 000 000 363 to 31 415 926 535 897 932 384 626 433 832 795 030 000 000 000 000 000 008 399, all rounding to 3.14 x 10^55.

The seed prime above was an arbitrary number chosen by getting the integer part of (pi x 1e55) and finding the next prime by typing:

Code: Select all

[g] [pi] 1e55 [*] [f] [IP] [f] [NEXTP]
Interestingly, in the primes above, the 34 digit real data of pi available in the WP43S can be seen as the 34 most significant digits of the integer. I wonder why there is yet another 34 in the mix (WP34S, WP43S, WP34C, WP43C, HP34C).
Jaco Mostert
Elec Eng, South Africa
WP34C, HP42S, DM42 for complex math; 35S, 28C, 32Sii, WP34S, EL-506P, EL-W506, PB700; owned FX702P & 11C; used 67 & 85. iOS: 42s (Byron), Free42, WP31S/34S, HCalc.
43S operators right. DM42 sn. 03818.

Post Reply