OFFSET
1,2
LINKS
Michel Marcus, Table of n, a(n) for n = 1..5000
Carlos Rivera, Puzzle 1045. One nice puzzle from Paolo Lava, The Prime Puzzles and Problems Connection.
EXAMPLE
124 gives 12/4 + 14/2 + 24/1 = 34, an integer, so 124 is a term.
221 gives 21/2 + 21/2 + 22/1 = 43, an integer, so 221 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(m) = {my(d=digits(m), res); if (vecmin(d), res = sum(j=1, #d, subs(d, j)/d[j]); (denominator(res)==1); ); }
(Python)
from fractions import Fraction
def ok(n):
s = str(n)
if '0' in s: return False
if len(s) == 1: return True
return sum(Fraction(int(s[:i]+s[i+1:]), int(s[i])) for i in range(len(s))).denominator == 1
print(list(filter(ok, range(813)))) # Michael S. Branicky, Jul 11 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Jul 11 2021
STATUS
approved