Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Peter's Files
Views: 3893
Visibility: Unlisted (only visible to those who know the link)
Image: ubuntu1804
Kernel: Python 3 (system-wide)
def is_a_vampire(n): if len(str(n)) % 2 != 0: return False for i in range(1, int((n) ** (1/2))): if n % i == 0: j = n // i if len(str(i)) == len(str(j)): if sorted(str(i) + str(j)) == sorted(str(n)): return (i,j) return False
for n in range(200000): v = is_a_vampire(n) if v: print(n, "=", " x ".join(str(e) for e in v))
1260 = 21 x 60 1395 = 15 x 93 1435 = 35 x 41 1530 = 30 x 51 1827 = 21 x 87 2187 = 27 x 81 6880 = 80 x 86 102510 = 201 x 510 104260 = 260 x 401 105210 = 210 x 501 105264 = 204 x 516 105750 = 150 x 705 108135 = 135 x 801 110758 = 158 x 701 115672 = 152 x 761 116725 = 161 x 725 117067 = 167 x 701 118440 = 141 x 840 120600 = 201 x 600 123354 = 231 x 534 124483 = 281 x 443 125248 = 152 x 824 125433 = 231 x 543 125460 = 204 x 615 125500 = 251 x 500 126000 = 210 x 600 126027 = 201 x 627 126846 = 261 x 486 129640 = 140 x 926 129775 = 179 x 725 131242 = 311 x 422 132430 = 323 x 410 133245 = 315 x 423 134725 = 317 x 425 135828 = 231 x 588 135837 = 351 x 387 136525 = 215 x 635 136948 = 146 x 938 139500 = 150 x 930 140350 = 350 x 401 143500 = 350 x 410 145314 = 351 x 414 146137 = 317 x 461 146952 = 156 x 942 150300 = 300 x 501 152608 = 251 x 608 152685 = 261 x 585 153000 = 300 x 510 153436 = 356 x 431 156240 = 240 x 651 156289 = 269 x 581 156915 = 165 x 951 162976 = 176 x 926 163944 = 396 x 414 172822 = 221 x 782 173250 = 231 x 750 174370 = 371 x 470 175329 = 231 x 759 180225 = 225 x 801 180297 = 201 x 897 182250 = 225 x 810 182650 = 281 x 650 182700 = 210 x 870 186624 = 216 x 864 190260 = 210 x 906 192150 = 210 x 915 193257 = 327 x 591 193945 = 395 x 491 197725 = 275 x 719