print primes in decimal, one per line. partition into intervals from 2^n to 2^(n+1)-1. hash each partition with MD5.
goal is to verify whether a prime number generator is working properly. here are results from primesieve version 6.3 packaged on Ubuntu 18.04 . future work: repeat with some other way of generating primes.
the first result is the MD5 hash of the empty string:
primesieve -p 1 1 | md5sum
d41d8cd98f00b204e9800998ecf8427e -
the next result is the hash of the string "2\n3\n":
primesieve -p 2 3 | md5sum
19283599a9866154a20cbb0be6adc1bc -
the next result is the hash of the string "5\n7\n":
primesieve -p 4 7 | md5sum
ec4aab475ce80bfd5469640c71b17108 -
primesieve -p 8 15 | md5sum
ea40c553d35c3769e4563356e5571312 -
primesieve -p 16 31 | md5sum
389ee0bc459bb738682302eaeeffdb9e -
primesieve -p 32 63 | md5sum
4625d9d99b82ddd64b2a7f744e81b5a2 -
primesieve -p 64 127 | md5sum
0d59f9c405e9f4ddd6a9dff34d995747 -
primesieve -p 128 255 | md5sum
24ac923d7d3fcb9ee30f660db48a896a -
primesieve -p 256 511 | md5sum
0def87cc99e15b8537b4fa735e9e173e -
primesieve -p 512 1023 | md5sum
09f3b02a4e83b28eb353da6b143173e5 -
primesieve -p 1024 2047 | md5sum
9a0e27c6dd0eb9c6f16896b1a19504f9 -
primesieve -p 2048 4095 | md5sum
f8812a2f97f570cc893c089aafacf7df -
primesieve -p 4096 8191 | md5sum
4dabac6164589732ef6f9ffa843c1125 -
primesieve -p 8192 16383 | md5sum
62b0b80451cc9e02de892c93cd5cac34 -
primesieve -p 16384 32767 | md5sum
4969d628ab6f72295afa9e663542cb59 -
primesieve -p 32768 65535 | md5sum
a90e03d5ce780a57bd962016af6a88b9 -
primesieve -p 65536 131071 | md5sum
7e9e7de2250a57a7aab73d8a347234c0 -
primesieve -p 131072 262143 | md5sum
725762c6e5d246e32a71fff4490eb345 -
primesieve -p 262144 524287 | md5sum
b87228cac6ba574ce059b06a89cf743b -
primesieve -p 524288 1048575 | md5sum
9db8a44d1018406bed9ddd810fdf7ed7 -
primesieve -p 1048576 2097151 | md5sum
00220343780b1453c9b7a634c4bcf395 -
primesieve -p 2097152 4194303 | md5sum
0b007f8da982f6bb8405bc1a987479ab -
primesieve -p 4194304 8388607 | md5sum
fbf768c73a8b3808ad987616df137937 -
primesieve -p 8388608 16777215 | md5sum
cbcd6f4bba8e755e38fec96f700bc6e4 -
primesieve -p 16777216 33554431 | md5sum
6be429185d33bf792dec21a9e2f838a8 -
primesieve -p 33554432 67108863 | md5sum
ba6d3bfb1b1fd482c2f6c2068e6def69 -
primesieve -p 67108864 134217727 | md5sum
5690fcae89b922e83149cde919d13b08 -
primesieve -p 134217728 268435455 | md5sum
e01b4b2f2665faa58a6c7c0e570c5623 -
primesieve -p 268435456 536870911 | md5sum
5e73b7013ea260fbc89689d196867c7f -
primesieve -p 536870912 1073741823 | md5sum
baacef4b4e06204e8c70e9e7b70caf51 -
primesieve -p 1073741824 2147483647 | md5sum
72922f6383a3a6003c3a7d648bb8e3da -
primesieve -p 2147483648 4294967295 | md5sum
9c1e25fef3b6abc9a1dca782bf5d422c -
primesieve -p 4294967296 8589934591 | md5sum
b45d191f562952acb0fe37aff3d92733 -
primesieve -p 8589934592 17179869183 | md5sum
e1ab401038abbef1283e57ca6f058e4b -
primesieve -p 17179869184 34359738367 | md5sum
153ae06a21b0fedce43b4fcd43c5ff6b -
primesieve -p 34359738368 68719476735 | md5sum
b0c7f4f0c04ffca5c3bb22bc48a8e5e1 -
primesieve -p 68719476736 137438953471 | md5sum
d0f12246675c9b5c9c3a373a509d42a1 -
primesieve -p 137438953472 274877906943 | md5sum
64e90d67029fc0e6deed56a0f564aad4 -
primesieve -p 274877906944 549755813887 | md5sum
26b043e2db96fb2c5e80da3898507372 -
primesieve -p 549755813888 1099511627775 | md5sum
6b7104f5a6e8dcac949350888a9df58a -
primesieve -p 1099511627776 2199023255551 | md5sum
71ee6df793118e85829074b152e59c73 -
primesieve -p 2199023255552 4398046511103 | md5sum
c420df38251cada4f31fb9df35dde6f1 -
primesieve -p 4398046511104 8796093022207 | md5sum
95c931c24f7a99483ac6d16b5530d838 -
primesieve -p 8796093022208 17592186044415 | md5sum
157266729337657753d52198f32a2698 -
primesieve -p 17592186044416 35184372088831 | md5sum
5d98aa14014d80dc646409f9103c9949 -
primesieve -p 35184372088832 70368744177663 | md5sum
6aa4896128011565848ccfad6f00418b -
the final result above is the MD5 checksum of all 46-bit primes that have their most significant bit set, that is, primes between 2^45 = 35184372088832 and 2^46 - 1 = 70368744177663 .
future work: this seems amenable to parallelization and tree hashing. let the leaves of the tree be the bitstring of prime and composite. reuse previously hashed results, especially of long strings of consecutive composites.
No comments :
Post a Comment