scramble prime challenge
|
02-16-2020, 02:19 PM
Post: #17
|
|||
|
|||
RE: scramble prime challenge
(02-15-2020 11:11 PM)Allen Wrote: I think it can be cut down to 57-59 without too much effort..Don, thanks for an interesting challenge! Using some random trials to pack the primes into fewer registers try to minimize the number of bytes used as sum(length(numbers)+number of registers) Code:
I looked at using primitive roots and indices to see if there was a cheaper way to store set membership, but since several of these primes are under 20, there is no primitive root product that has a smaller product than just these primes. For example, \( 7^p \mod 997 \) is a primitive root with a unique index for all of these primes \(p \), but you get [49, 343, 855, 21, 571, 63, 716, 704, 118, 433, 280, 840, 746, 818, 152, 936, 278, 700, 833, 601, 241, 667] rather than the original list.. which has no numbers under 20. (plus there is a minor annoyance that none of the HP calculators I know of have modular exponentiation.. maybe the prime does?) Our hand held could not calculate \( 7^{991} =91706260460847671 \ldots 772735017410743 \) (883 decimal digits ) but with a small program could easily calculate \( 7^{991} \mod 997 = 667 \) Modular exponential on HP 42S (free42 program) enter base,exponent, modulus then XEQ PMOD returns \( b ^ x \mod m\) on ST X Code:
17bii | 32s | 32sii | 41c | 41cv | 41cx | 42s | 48g | 48g+ | 48gx | 50g | 30b |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: