Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,27 @@
ClearAll[VampireQ]
VampireQ[num_Integer] := Module[{poss, divs},
divs = Select[Divisors[num], # <= Sqrt[num] &];
poss = {#, num/#} & /@ divs;
If[Length[poss] > 0,
poss = Select[poss, Mod[#, 10] =!= {0, 0} &];
If[Length[poss] > 0,
poss = Select[poss, Length[IntegerDigits[First[#]]] == Length[IntegerDigits[Last[#]]] &];
If[Length[poss] > 0,
poss = Select[poss, Sort[IntegerDigits[num]] == Sort[Join @@ (IntegerDigits /@ #)] &];
If[Length[poss] > 0
,
Sow[{num, poss}];
True
,
False
]
,
False
]
,
False
]
,
False
]
]

View file

@ -0,0 +1,2 @@
Reap[Scan[VampireQ,Range[126027]]][[2,1]]//Grid
Reap[VampireQ[#]] & /@ {16758243290880, 24959017348650, 14593825548650} // Grid