Post Reply 
puzzle
06-29-2018, 07:53 AM
Post: #3
RE: puzzle
(06-29-2018 04:27 AM)Thomas Klemm Wrote:  
(06-29-2018 03:40 AM)Don Shepherd Wrote:  How many 4-digit arrangements would you have to check?
Code:
Spoiler Alert












12 = 4! / 2!

1223
1232
1322
2123
2132
2213
2231
2312
2321
3122
3212
3221
Code:
Spoiler Alert









6 if you initially discount the even numbers by inspection - there are only two choices for the units digit.

(You have filtered out the even numbers out in the next step.)
Quote:
Quote:Is there a way to check other than an electronic prime factor finder or our old friend, brute force?
Code:
Spoiler Alert












Even numbers are rarely prime:
1232
1322
2132
2312
3122
3212

Check alternating sum of digits:
2123 -> 2 - 1 + 2 - 3 = 0 => divisible by 11: 2123 = 11 * 193
2321 -> 2 - 3 + 2 + 1 = 0 => divisible by 11: 2321 = 11 * 211

Brute force:
2231 = 23 * 97
Code:
Spoiler Alert












You could also do an initial sum over the digits:

1+2+3+2 = 8

Not a multiple of 3, so it is worth considering other checks for primality. If the given number was 1233, it would fail this initial test - all arrangements would be divisible by 3.
Quote:That was fun.

I really wish there was a [spoiler]spoiler[/spoiler] tag!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
puzzle - Don Shepherd - 06-29-2018, 03:40 AM
RE: puzzle - Thomas Klemm - 06-29-2018, 04:27 AM
RE: puzzle - ijabbott - 06-29-2018 07:53 AM
RE: puzzle - Don Shepherd - 06-29-2018, 12:15 PM
RE: puzzle - Thomas Klemm - 06-29-2018, 02:08 PM
RE: puzzle - brickviking - 06-30-2018, 11:32 PM



User(s) browsing this thread: 1 Guest(s)