OFFSET
1,1
LINKS
Michel Marcus, Table of n, a(n) for n = 1..441
Carlos Rivera, Puzzle 1045. One nice puzzle from Paolo Lava, The Prime Puzzles and Problems Connection.
EXAMPLE
21673 gives 1673/2 + 2673/1 + 2173/6 + 2163/7 + 2167/3 = 4903; so 21673 is a term.
PROG
(PARI) subs(d, j) = {my(x=""); for (k=1, #d, if (j != k, x = concat(x, d[k])); ); eval(x); }
isok(p) = {my(d=digits(p), res); if (isprime(p) && vecmin(d), res = sum(j=1, #d, subs(d, j)/d[j]); (denominator(res)==1) && isprime(res); ); }
(Python)
from sympy import isprime, primerange
from fractions import Fraction
def ok(p):
s = str(p)
if '0' in s or len(s) == 1: return False
f = sum(Fraction(int(s[:i]+s[i+1:]), int(s[i])) for i in range(len(s)))
return f.denominator == 1 and isprime(f.numerator)
def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p)]
print(aupto(1620000)) # Michael S. Branicky, Jul 11 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Jul 10 2021
STATUS
approved