Prom numbers

A b b -prom number is a positive integer which is the concatenation of the product of its digits and the sum of its digits in base b b . For example, 3612 3612 is a 10-prom number, since the product of its digits is 36 36 and the sum of its digits is 12 12 , and 3612 3612 is the concatenation of 36 36 and 12 12 . Note that 1236 1236 is not a 10-prom number; the concatenation must be the product before the sum. Also note that 01 01 is not a 10-prom number; prom numbers may not begin with 0 0 .

What is the only 3-digit 10-prom number?


The answer is 911.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Bill Bell
Aug 2, 2015
1
2
3
4
5
6
def is10Prom(n):
    return str(n)==str(reduce(lambda a,b: a*b,map(int,list(str(n))),1))+str(sum(map(int,list(str(n)))))

for n in range(100,1000):
    if is10Prom(n):
        print n

Ankush Tiwari
Apr 8, 2014

In java:

public class prom

{

void main()

{

    for(int i=100;i<=999;i++)

    {

        int a=i;

        int p=1; int s=0;

        while(a>0)

        {

            int d=a%10;

            p*=d;

            s+=d;

            a/=10;

        }

        String x= ""+p+s;

        String y = ""+i;

        if(x.equalsIgnoreCase(y))

        System.out.println(i);

    }

}

}

Pebrudal Zanu
Jan 14, 2014

Suppose the number are a , b , c a,b,c

Case I, If a × b × c a \times b\times c two digit and a + b + c a+b+c only one digit.

    for a in range (1,10):

for b in range (1,10):

    for c in range (1,10):

        d=a*b*c

        e=a+b+c

        if 10*d+e==100*a+10*b+c and e<10:

            print a,b,c

There is no result.

Case II. If a × b × c a \times b\times c only one digit and a + b + c a+b+c two digit.

    for a in range (1,10):

for b in range (1,10):

    for c in range (1,10):

        d=a*b*c

        e=a+b+c

        if 100*d+e==100*a+10*b+c and d<10:

            print a,b,c

The result is 9 1 1

So the answer 911 \fbox{911}

:D

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...