Latest LQ Deal: Latest LQ Deals
 LinuxQuestions.org [SOLVED] A curious mathematical principle
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 08-05-2020, 06:49 PM #1 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Blog Entries: 4 Rep: A curious mathematical principle Caveat: This is not a programming question per se, but am posting here for LQ minds attuned to logic and mathematics. Recently wanted to generate a 6-digit prime number from the set of digits {0,1,2,3,4,5} or {1,2,3,4,5,6}. Goal: Generate a six digit prime number using each digit in the set exactly once, in any order. After a few failed attempts, I started puzzling and soon remembered a mathematical principle via which I knew, without having to write a program or trying all possible combinations, that my goal was impossible given either of the above two sets of six digits. Rules: Assume normal base-10 integers. Use each of the six digits in the set in any order. Leading zero OK. Obviously, the final digit may not be an even number or a five, so only numbers ending in a 1 or 3 need be tried. This leaves 240 possible combinations of digits for each 6-digit set. None of which are prime. Other sets such as {1,4,6,7,8,9} or {3,6,7,1,8,4} might yield one or more prime numbers (e.g. 417869 and 186437). But there are no prime numbers containing the six digits {0,1,2,3,4,5} or {1,2,3,4,5,6} I can explain why. Can you? Am confident someone in LQ land is already aware of the mathematical principle involved, which can also lead to a neat number trick to play on friends. Possibly more to follow.
 08-05-2020, 07:04 PM #2 danielbmartin Senior Member   Registered: Apr 2010 Location: Apex, NC, USA Distribution: Mint 17.3 Posts: 1,779 Rep: Is this it? Prime Factors of Consecutive Integers E. F. Ecklund and R. B. Eggleton The American Mathematical Monthly Vol. 79, No. 10 (Dec., 1972), pp. 1082-1089 Daniel B. Martin .
 08-05-2020, 07:50 PM #3 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Original Poster Blog Entries: 4 Rep: No. Have never heard of the work you cited, and don't understand the relationship to my puzzle. I've presented the two sets of digits in ascending order, but the curiosity is that no matter what sequence in which the digits are arranged the resulting number is not prime, and there is a mathematical principle to prove it without trying all such sequences. By the way, I think there's at least one prime number (23456789) consisting of consecutively ordered digits.
 08-06-2020, 04:09 PM #4 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Original Poster Blog Entries: 4 Rep: Here's a hint 1 members found this post helpful.
08-06-2020, 05:04 PM   #5
danielbmartin
Senior Member

Registered: Apr 2010
Location: Apex, NC, USA
Distribution: Mint 17.3
Posts: 1,779

Rep:
Quote:
 Originally Posted by dogpatch Here's a hint
John 1:14 but where does that lead us? To the promised land? Didn't somebody else already do that?

Daniel B. Martin

 08-06-2020, 05:29 PM #6 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Original Poster Blog Entries: 4 Rep: Click on the hyperlink 'hint' (Nice job decoding my signature, but that wasn't the hint)
 08-07-2020, 03:49 AM #7 mina86 Member   Registered: Aug 2008 Distribution: Debian Posts: 517 Rep: The digits sum to a number divisible by 3.
 08-11-2020, 06:29 PM #8 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Original Poster Blog Entries: 4 Rep: Specifically, as the above link explains, the modulo-9 of any multi-digit number can be obrained by adding the digits until you have a single digit. That digit is the modulo-9 of the number, or, if the single digit is a 9, the modulo-9 is zero. This holds true for all multi-digit base 10 numbers regardless of the order of the digits. (It likewise works for modulo-7 of any multi-digit octal number, modulo-f of any hex number, etc.) Thus, a base 10 number formed by the six digits {0,1,2,3,4,5} will always have a modulo-9 of 6: 0+1+2+3+4+5 = 15, => 1+5 = 6 A number formed by the six digits {1,2,3,4,5,6} will always have a modulo-9 of 3: 1+2+3+4+5+6 = 21, => 2+1 = 3 Since 9, 6, and 3 are evenly divisible by 3, any number formed by either of these sets of six digits will be evenly divisible by 3, and therefore not prime. Last edited by dogpatch; 08-11-2020 at 06:30 PM. 2 members found this post helpful.
 08-14-2020, 07:09 PM #10 dogpatch Member   Registered: Nov 2005 Location: Central America Distribution: Mepis, Android Posts: 427 Original Poster Blog Entries: 4 Rep: One more little detail: It may rarely happen that when you tell your friend(s) to eliminate one of the digits (step 4 above), they may say "But there's only one digit left", in that rare case, you can tell them in all confidence that that one digit is a 9. e.g. 443, scrambled 434, subtract = 9

 Tags math, phenomenon, prime numbers

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post heavytull Linux - Software 2 12-16-2011 11:04 AM LXer Syndicated Linux News 2 09-25-2010 11:13 AM LXer Syndicated Linux News 0 12-02-2008 07:20 PM sitthar Linux - General 3 04-08-2006 08:05 AM

LinuxQuestions.org

All times are GMT -5. The time now is 01:29 PM.

 Contact Us - Advertising Info - Rules - Privacy - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -