Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
popcount[n_Integer] := IntegerDigits[n, 2] // Total
|
||||
perniciousQ[n_Integer] := popcount[n] // PrimeQ
|
||||
perniciouscount = 0;
|
||||
perniciouslist = {};
|
||||
i = 0;
|
||||
While[perniciouscount < 25,
|
||||
If[perniciousQ[i], AppendTo[perniciouslist, i]; perniciouscount++];
|
||||
i++]
|
||||
Print["first 25 pernicious numbers"]
|
||||
perniciouslist
|
||||
(*******)
|
||||
perniciouslist2 = {};
|
||||
Do[
|
||||
If[perniciousQ[i], AppendTo[perniciouslist2, i]]
|
||||
, {i, 888888877, 888888888}]
|
||||
Print["Pernicious numbers between 888,888,877 and 888,888,888 (inclusive)"]
|
||||
perniciouslist2
|
||||
|
|
@ -0,0 +1 @@
|
|||
perniciousQ[n_Integer] := PrimeQ@Total@IntegerDigits[n, 2]
|
||||
|
|
@ -0,0 +1 @@
|
|||
n = 0; NestWhile[Flatten@{#, If[perniciousQ[++n], n, {}]} &, {}, Length@# < 25 &]
|
||||
|
|
@ -0,0 +1 @@
|
|||
Cases[Range[888888877, 888888888], _?(perniciousQ@# &)]
|
||||
Loading…
Add table
Add a link
Reference in a new issue