Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Wasron,jfgw,Rhyd6,eyeball08,Wondergirly, for Donating to support the site

Product

cinelli
Lemon Slice
Posts: 554
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Product

#598819

Postby cinelli » June 29th, 2023, 12:30 pm

Find two whole numbers with the smallest possible difference between them which, when multiplied together, will produce 1234567890.

Cinelli

NotSure
Lemon Slice
Posts: 920
Joined: February 5th, 2021, 4:45 pm
Has thanked: 685 times
Been thanked: 316 times

Re: Product

#598832

Postby NotSure » June 29th, 2023, 1:35 pm

Brute forced it in about 10 seconds, but would be interested in how to do it properly!

34227 36070

UncleEbenezer
The full Lemon
Posts: 10817
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1472 times
Been thanked: 3006 times

Re: Product

#598875

Postby UncleEbenezer » June 29th, 2023, 4:39 pm

NotSure wrote:Brute forced it in about 10 seconds, but would be interested in how to do it properly!

By brute force, do you mean you delegated the entire task to the 'puter?

Does it count as any better if you factorise it? Unfortunately the easy factors stop after dividing by 90 (2x3x3x5). So that takes us straight back to brute force to extract the other two factors, after which your solution is obvious.

NotSure
Lemon Slice
Posts: 920
Joined: February 5th, 2021, 4:45 pm
Has thanked: 685 times
Been thanked: 316 times

Re: Product

#598876

Postby NotSure » June 29th, 2023, 4:42 pm

UncleEbenezer wrote:
NotSure wrote:Brute forced it in about 10 seconds, but would be interested in how to do it properly!

By brute force, do you mean you delegated the entire task to the 'puter?

Does it count as any better if you factorise it? Unfortunately the easy factors stop after dividing by 90 (2x3x3x5). So that takes us straight back to brute force to extract the other two factors, after which your solution is obvious.


Fraid so. Started at the square root and iterated backwards until integer factor was found :(

cinelli
Lemon Slice
Posts: 554
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Product

#599027

Postby cinelli » June 30th, 2023, 11:45 am

Well done, NotSure. Ten seconds is good going. I will try to make the next one harder.

Cinelli

GoSeigen
Lemon Quarter
Posts: 4440
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1614 times
Been thanked: 1607 times

Re: Product

#599065

Postby GoSeigen » June 30th, 2023, 3:30 pm

cinelli wrote:Well done, NotSure. Ten seconds is good going. I will try to make the next one harder.

Cinelli


Some of us are too lazy to brute force a factorisation, and also too dim to find better solutions quickly.

If there's a more elegant method could you give a bit more time before revealing it please?


Cheers.

GS

NotSure
Lemon Slice
Posts: 920
Joined: February 5th, 2021, 4:45 pm
Has thanked: 685 times
Been thanked: 316 times

Re: Product

#599066

Postby NotSure » June 30th, 2023, 3:36 pm

GoSeigen wrote:Some of us are too lazy to brute force a factorisation,GS


two short lines of python (but pointless).

GoSeigen wrote:
and also too dim to find better solutions quickly.


Guilty as charged, except substitute "ever" for "quickly" in my case :)

jfgw
Lemon Quarter
Posts: 2565
Joined: November 4th, 2016, 3:36 pm
Has thanked: 1108 times
Been thanked: 1167 times

Re: Product

#599074

Postby jfgw » June 30th, 2023, 4:11 pm

GoSeigen wrote:Some of us are too lazy to brute force a factorisation...

Is there a method of factorising that doesn't use brute force?

Once I got down to 13717421 and didn't find any more factors manually before giving up, I delegated the task to a computer. (3607*2*5)*(3803*3*3) seemed most likely.

I like NotSure's idea of starting at the square root as it guarantees the correct answer.


Julian F. G. W.

cinelli
Lemon Slice
Posts: 554
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Product

#599094

Postby cinelli » June 30th, 2023, 5:58 pm

Without giving away my source, this puzzle is more than a hundred years old. I would guess that the setter had a list of prime numbers and, as NotSure has suggested, if you start at the square root of 13717421, about 3708, and work upwards, it takes only about 8 long divisions until you come to 3803. Digital root considerations mean you don’t have to do all the divisions.

Cinelli

GoSeigen
Lemon Quarter
Posts: 4440
Joined: November 8th, 2016, 11:14 pm
Has thanked: 1614 times
Been thanked: 1607 times

Re: Product

#599104

Postby GoSeigen » June 30th, 2023, 6:41 pm

jfgw wrote:
GoSeigen wrote:Some of us are too lazy to brute force a factorisation...

Is there a method of factorising that doesn't use brute force?


Not in the general case of course, but mightn't there have been something cunning in the construction of this particular question that made it easily soluble? [Hence my "If there's a more elegant method..."]

It's pure luck that the factors are so close to the square root. There are some 500 prime numbers less than the root of 13717421 so potentially it could have taken 250 divisions whichever direction you worked from -- and that is with a list of primes available.


GS

CliffEdge
Lemon Quarter
Posts: 1561
Joined: July 25th, 2018, 9:56 am
Has thanked: 459 times
Been thanked: 434 times

Re: Product

#599160

Postby CliffEdge » July 1st, 2023, 12:43 am

I'd be happy with an aliquant answer but I'm transforming into a hippy, man.


Return to “Games, Puzzles and Riddles”

Who is online

Users browsing this forum: No registered users and 37 guests