A327750 Numbers without zero digits such that after adding the product of its digits to it, a number with the same product of digits is obtained.
28, 128, 214, 239, 266, 318, 326, 364, 494, 497, 563, 598, 613, 637, 695, 819, 1128, 1214, 1239, 1266, 1318, 1326, 1364, 1494, 1497, 1563, 1598, 1613, 1637, 1695, 1819, 2114, 2139, 2168, 2285, 2313, 2356, 2369, 2419, 2594, 2639, 2791, 3118, 3126, 3148, 3213, 3235
Offset: 1
Examples
28 + 2*8 = 44 and 2*8 = 4*4 hence 28 is a term. 326 + 3*2*6 = 362 and 3*2*6 = 3*6*2 hence 326 is another term.
Links
- Michel Marcus, Table of n, a(n) for n = 1..10000
- Roman Fedorov, Alexei Belov, Alexander Kovaldzhi, Ivan Yashchenko, Moscow Mathematical Olympiads, 2000-2005, Level A, Problem 2, 2003; MSRI, 2011, p. 15 and 97.
- Index to sequences related to Olympiads.
Programs
-
Magma
[k:k in [1..3500]| not 0 in Intseq(k) and &*Intseq(k) eq &*(Intseq(k+&*Intseq(k)))]; // Marius A. Burtea, Sep 24 2019
-
Mathematica
pd[n_] := Times @@ IntegerDigits[n]; aQ[n_] := (p = pd[n]) > 0 && pd[n + p] == p; Select[Range[5000], aQ] (* Amiram Eldar, Sep 24 2019 *)
-
PARI
isok(n) = my(d = digits(n), p); vecmin(d) && (p=vecprod(d)) && (vecprod(digits(n+p)) == p); \\ Michel Marcus, Sep 24 2019
-
Python
def test(n): m, p = n, 1 while m > 0: m, p = m//10, p*(m%10) if p == 0: return 0 m, q = n+p, 1 while m > 0: m, q = m//10, q*(m%10) return p == q n, a = 0, 0 while n < 100: a = a+1 if test(a): n = n+1 print(n,a) # A.H.M. Smeets, Sep 25 2019
Extensions
More terms from Amiram Eldar, Sep 24 2019
Comments