A034710 Positive numbers for which the sum of digits equals the product of digits.
1, 2, 3, 4, 5, 6, 7, 8, 9, 22, 123, 132, 213, 231, 312, 321, 1124, 1142, 1214, 1241, 1412, 1421, 2114, 2141, 2411, 4112, 4121, 4211, 11125, 11133, 11152, 11215, 11222, 11251, 11313, 11331, 11512, 11521, 12115, 12122, 12151, 12212, 12221, 12511
Offset: 1
Examples
1124 is a term since 1 + 1 + 2 + 4 = 1*1*2*4 = 8.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..27597 (first 1200 terms from T. D. Noe)
Crossrefs
Programs
-
Haskell
import Data.List (elemIndices) a034710 n = a034710_list !! (n-1) a034710_list = elemIndices 0 $ map (\x -> a007953 x - a007954 x) [1..] -- Reinhard Zumkeller, Mar 19 2011
-
Magma
[n: n in [1..10^6] | &*Intseq(n) eq &+Intseq(n)] // Jaroslav Krizek, Oct 25 2014
-
Mathematica
Select[Range[12512], (Plus @@ IntegerDigits[ # ]) == (Times @@ IntegerDigits[ # ]) &] (* Alonso del Arte, May 16 2005 *)
-
PARI
is(n)=my(d=digits(n)); vecsum(d)==factorback(d) \\ Charles R Greathouse IV, Feb 06 2017
Extensions
Corrected by Larry Reeves (larryr(AT)acm.org), Jun 27 2001
Definition changed by N. J. A. Sloane to specifically exclude 0, Sep 22 2007
Comments