Data update

This commit is contained in:
Ingy döt Net 2023-10-02 18:11:16 -07:00
parent 796d366b97
commit 35bcdeebf8
504 changed files with 7045 additions and 610 deletions

View file

@ -7,4 +7,4 @@ def is_deceptive(n):
if not (n % d and n % (d + 4)): return True
return False
print(*islice(filter(is_deceptive, count()), 100))
print(*islice(filter(is_deceptive, count(49)), 100))

View file

@ -0,0 +1,16 @@
from itertools import accumulate, cycle, islice
from math import isqrt
primes = []
wheel = 4, 2, 4, 2, 4, 6, 2, 6
def is_pseudo(n):
if pow(10, n - 1, n) == 1:
s = isqrt(n)
for p in primes:
if p > s: break
if n % p == 0: return True
primes.append(n)
return False
print(*islice(filter(is_pseudo, accumulate(cycle(wheel), initial=7)), 100))