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

Home > Numbers
Primes in Squares (Posted on 2010-10-19) Difficulty: 3 of 5
31329 is a 5-digit perfect square. It happens that its digits can be used successively, with a couple of dividing spaces, to form three prime numbers: two with two digits each, and one with only one digit:

31 3 29

It's also possible to do this subdividing another way: 3 13 29.

Several other 5-digit squares can be divided in this manner into two 2-digit primes and one 1-digit prime. But the goal of this particular puzzle is to find three such squares so that a total of nine different primes are formed by the subdivisions, being of course six 2-digit primes and three 1-digit primes due to the nature of how they were formed.

There are no leading zeros for any of the primes or squares. I'll tell you this: 31329 is unique in having two ways of being split in this manner. All the rest of the squares for which this is possible have only one way of being validly split.

  Submitted by Charlie    
No Rating
Solution: (Hide)
   5   PrevSq=""
  10   St=-int(-sqrt(10000))
  20   Fin=int(sqrt(99999))
  30   print St,Fin
  40   for N=St to Fin
  50     Sq=cutspc(str(N*N))
  60     A=mid(Sq,1,2)
  61     B=mid(Sq,3,2)
  62     C=mid(Sq,5,1)
  65     gosub *Test
  70     A=mid(Sq,1,2)
  71     B=mid(Sq,3,1)
  72     C=mid(Sq,4,2)
  75     gosub *Test
  80     A=mid(Sq,1,1)
  81     B=mid(Sq,2,2)
  82     C=mid(Sq,4,2)
  85     gosub *Test
 200   next
 300   end
 400   *Test
 405   Good=1
 410   if left(A,1)="0" or left(B,1)="0" or left(C,1)="0" then Good=0
 420   if A="1" or B="1" or C="1" then Good=0
 430   if prmdiv(val(A))PrevSq then print:endif
 470   :print Sq;:PrevSq=Sq
 480   :print " ";A;" ";B;" ";C
 500   return

finds
 
 100     316

29241 29 2 41

31329 31 3 29
31329 3 13 29

53361 53 3 61

71289 71 2 89

72361 7 23 61

76729 7 67 29

78961 7 89 61 

showing that the squares from 100^2 through 316^2 were checked--that is all the 5-digit squares.

Each line shows the square, and the three primes comprising it. The primes included in each square (other than the one that can be done in two ways) can be summarized, laid out left-to-right in order of the primes:

         2   3   7  13  23  29  31  41  53  61  67  71  89
29241    x                   x       x
53361        x                           x   x
71289    x                                           x   x
72361            x       x                   x
76729            x           x                   x
78961            x                           x           x

53361, 71289 and 76729 don't share any primes in common. The full list of those primes is 2, 3, 7, 29, 53, 61, 67, 71 and 89.

Based on Enigma No. 1604, "From primes to squares", by Richard England, New Scientist, 17 July 2010, page 24.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
re: Excel Assisted bottemiller2010-10-21 20:52:59
SolutionExcel Assistbrianjn2010-10-19 21:16:24
Some Thoughtspossible solutionbroll2010-10-19 13:40:02
solutioned bottemiller2010-10-19 12:30:58
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
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