- Thread starter lincoln40113
- Start date

I brute forced the solution and the answer is quite nice. The problem is I can't find a nice alternative reason for why that answer is what it is...

i know it's inefficient but i was basically planning on have a list of numbers from 1111111 to 7777777 and then just let R see whether there were any repeated digits in any given numbers and, if they were, throw them out so i ended up with the sub-set that's needed.

how did you do it? i was thinking on taking that approach as well.

i know it's inefficient but i was basically planning on have a list of numbers from 1111111 to 7777777 and then just let R see whether there were any repeated digits in any given numbers and, if they were, throw them out so i ended up with the sub-set that's needed.

i know it's inefficient but i was basically planning on have a list of numbers from 1111111 to 7777777 and then just let R see whether there were any repeated digits in any given numbers and, if they were, throw them out so i ended up with the sub-set that's needed.

Side note, I think the OP was looking for a formula style equation just to plug numbers into, does one of those exist, if so would that run faster than your code Dason, probably. Not ripping on your code but woundering about the most efficient method. Seems like a BGM question. Somebody put out the factorial bat signal.

Looks like the cyclone > golden hurricane + residuals.

The issue is that I don't know of a nice test for divisibility by 7. It's not like 2 or 5 where you can just look at the digit in the 1s place or like 3 where you can look at if the sum of all the digits is divisible by 3...

And I doubt Spunky's code would run faster than mine. spunky would need to check 7777777-1111111 = 6666666 values whereas mine just needs to check 7!=5040 values.

Edit: Although you could make spunky's approach slightly better by only starting at 1234567 and ending at 7654321.

And I doubt Spunky's code would run faster than mine. spunky would need to check 7777777-1111111 = 6666666 values whereas mine just needs to check 7!=5040 values.

Edit: Although you could make spunky's approach slightly better by only starting at 1234567 and ending at 7654321.

Last edited: