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

Home > Numbers
Pandigital Product Crossed Square Poser (Posted on 2023-01-06) Difficulty: 3 of 5
Each of A, B, and C is a different zeroless pandigital number that satisfy this equation:

A*B=C2

Determine the minimum value of C.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
thank you | Comment 4 of 18 |
That is a great compliment, Charlie; thank you.

Regarding algorithms, my first thought was to try every combination of 2 pandigitals, take the square root, and check.  I quickly saw one could just make a list of the squares and eliminate the square root step.  But still O(n^2) to check all the pandigital combinations.

Next, {tl;dr I ended up not doing this}  I thought about manipulating A and B so I could get the difference of 2 squares and then try to match the squares to a Pythagorean triple.  I had forgotten about Euclid's formula for generating Pythagorean triples, but rediscovered it.

Let mean = (a+b)/2  and diff = (a-b)/2  
(mean+diff)(mean-diff) = a * b = c^2
mean^2 - diff^2 = c^2
diff^2 + c^2 = mean^2  where
 c is pandigital, and
 mean is the midpoint between a and b, and
 diff is the distance from the mean to either a or b

Euclid's formula for generating a Pythagorean triple x^2 + y^2 = z^2
For positive integers m,n m>n
  x = m^2 - n^2 ... y = 2mn ... z = m^2 + n^2 of which x or y is pandigital

But I abandoned this quest and stopped working on it.  This was several days ago.

Then this morning after the problem posted, I just came up with the algorithm which ended up working.  I think sometimes the algorithm ideas have to churn around in the background before they gel into butter.
  Posted by Larry on 2023-01-06 15:07:33
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 (11)
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