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

Home > Numbers
October and 11 Prime Numbers (Posted on 2024-05-03) Difficulty: 3 of 5
Reconstruct the multiplication:

                               
       * * * * * *         where:  O C T O
               * *                   C T O
      -------------                  C T O B
       * * * * * *                     T O
     * * * * * *                       T O B E
    ---------------                    T O B E R
     O C T O B E R                       O B E R
                                           B E R
                                           B E
                                             E R
                                               R
                           are 11 prime numbers.

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.)
Solution Computer Solution Comment 2 of 2 |
TOBER can only be [13613, 29173, 97673]
CTO can only be 829
CTOBER must be 829173
OCTO?:  while either a 6, 7, or 9 can preceed 829 and still be prime, O has already been determined to be 9.
OCTOBER can only be one number:  9829173
its prime factors are 3 x 29 x 112979
So the multiplication can either be 112979 x 87  or 338937 x 29
However 338937 x 9 is seven digits, the graphic has six digits, so it must be:
    112979
            87
  ----------
    790853
  903832
  ----------
 9829173

================
I did parts of the code in stages getting some preliminary results and using a narrowed down list for later code segments.

primes = [p for p in range(100000) if isprime(p)]
p2s = [p for p in primes if len(str(p)) == 2]
p3s = [p for p in primes if len(str(p)) == 3]
p4s = [p for p in primes if len(str(p)) == 4]
p5s = [p for p in primes if len(str(p)) == 5]
TOB = []
TOBER = []
possibleCs = []
CTO = []
OCTO = []

for p in p5s:
    if p%10 not in [3,7]:
        continue
    if p%10000 not in p4s:
        continue
    if p%1000 not in p3s:
        continue
    if p%100 not in p2s:
        continue
    if (p%1000)//10 not in p2s:
        continue
    if p//10 not in p4s:
        continue
    if p//1000 not in p2s:
        continue
    
    TOB.append(p//100)
    TOBER.append(p)


for t in TOB:
    for c in range(1,10):
        if c*1000 + t not in p4s:
            continue
        if c*100 + t//10 not in p3s:
            continue
        possibleCs.append(c)
        CTO.append(c*100 + t//10)
        
for c in range(1,10):
    if c*1000 + 829 not in p4s:
        continue
    OCTO.append(c*1000 + 829)

  Posted by Larry on 2024-05-03 13:56:34
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 (20)
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