login
A375936
Prime numbers p such that there exists a base b < 10 in which p is written as a number that is divisible by p when read as a decimal number.
0
2, 3, 5, 7, 2753, 2927, 9431, 10861, 34217, 70537, 104891, 1200341, 3427673, 3583417, 22772791, 323869489
OFFSET
1,1
COMMENTS
No other terms below 10^11.
LINKS
EXAMPLE
7 = 21_3 and 21 / 7 = 3
2753 = 11012_7 and 11012 / 2753 = 4
In each example the base is < 10. See a375936.txt in section Links for more examples.
MATHEMATICA
q[p_] := AnyTrue[Range[2, 9], Divisible[FromDigits[IntegerDigits[p, #]], p] &]; Select[Prime[Range[260000]], q] (* Amiram Eldar, Sep 03 2024 *)
PROG
(Python)
from gmpy2 import digits, is_prime, mpz
def ok(n): return is_prime(n) and any(mpz(digits(n, b))%n == 0 for b in range(2, 10))
print([k for k in range(10**7) if ok(k)]) # Michael S. Branicky, Sep 03 2024
(PARI) isok(k) = if (isprime(k), for (b=2, 9, if (!(fromdigits(digits(k, b)) % k), return(b)))); \\ Michel Marcus, Sep 04 2024
CROSSREFS
Sequence in context: A252357 A037948 A007659 * A288715 A208361 A145380
KEYWORD
nonn,base,more,new
AUTHOR
Jean-Marc Rebert, Sep 03 2024
STATUS
approved