All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Digital Product Triples #2 (Posted on 2024-04-11) Difficulty: 3 of 5
The digital product P(N) of an integer N is the product of its decimal digits. So P(128)=16.

Determine all sets of distinct positive integers A and B such that A = P(B)P(C) and B = P(A)P(C) for some integer C.

For each pair, A and B, give the lowest possible value for C.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 1 of 1
The program finds values of n*P(n) for matching in the cross multiplication of A*P(B) = B*P(B), for A/P(B) = B/P(A).

When found, A/P(B) or its equivalent B/P(A) must be an integer and its largest prime factor must be under 10.

nList=[]; pList=[];
for n=1:999999
  ns=num2str(n);
  if ~contains(ns,'0')
    nList(end+1)=n;
    pList(end+1)=n*prod(ns-48);
  end
end

[pList,idx] = sort(pList);
nList=nList(idx);

clc
for i=1:length(nList)-1
  if pList(i)==pList(i+1)
    a=nList(i);b=pList(i+1)/nList(i+1);
    if a/b==round(a/b) && max(factor(a/b))<10
      fprintf('%11d %11d %11d\n',[nList(i),nList(i+1),a/b])
    end
  end
end

finds only

          A           B          P(C)

         24          32           4
         48          64           2
        288         384           3
        
As it turns out, P(C) is the same as the smallest C in each instance.        

          24 = 6 * 4
          32 = 8 * 4
          
          48 = 24 * 2
          64 = 32 * 2
          
          288 = 96 * 3
          384 = 128 * 3
          
Of course A and B can be interchanged.          

  Posted by Charlie on 2024-04-11 13:35:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information