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

Home > Numbers
Pairs of primes (Posted on 2008-09-21) Difficulty: 2 of 5
A total of 12 digits are placed in a sequence such that the 11 pairs of subsequent digits form 11 different prime numbers.

What is the second digit in this sequence, and what is the last?

See The Solution Submitted by pcbouhid    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Each of the 192 such sequences ... | Comment 2 of 3 |

... has a 1 in the second position and a 9 in the last position.

It also begins with either a 4 or a 6:

411317197379 411317371979 411317379719 411317973719 411319717379 411319737179
411371731979 411371797319 411371973179 411373171979 411373179719 411373197179
411379717319 411379731719 411713197379 411713731979 411713797319 411719731379
411731371979 411731379719 411731971379 411737131979 411737971319 411797137319
411797313719 411797371319 411971317379 411971373179 411971731379 411973137179
411973171379 411973713179 413117197379 413117371979 413117379719 413117973719
413119717379 413119737179 413171197379 413173711979 413173797119 413179737119
413197117379 413197371179 413711731979 413711797319 413711973179 413717311979
413717973119 413719731179 413731171979 413731179719 413731197179 413731711979
413731797119 413731971179 413797117319 413797173119 413797311719 413797317119
417113197379 417113731979 417113797319 417119731379 417131197379 417137311979
417137973119 417197311379 417311371979 417311379719 417311971379 417313711979
417313797119 417319711379 417371131979 417371311979 417379711319 417379713119
417971137319 417971373119 417973113719 417973137119 417973711319 417973713119
419711317379 419711373179 419711731379 419713117379 419713731179 419717311379
419731137179 419731171379 419731371179 419731711379 419737113179 419737131179
611317197379 611317371979 611317379719 611317973719 611319717379 611319737179
611371731979 611371797319 611371973179 611373171979 611373179719 611373197179
611379717319 611379731719 611713197379 611713731979 611713797319 611719731379
611731371979 611731379719 611731971379 611737131979 611737971319 611797137319
611797313719 611797371319 611971317379 611971373179 611971731379 611973137179
611973171379 611973713179 613117197379 613117371979 613117379719 613117973719
613119717379 613119737179 613171197379 613173711979 613173797119 613179737119
613197117379 613197371179 613711731979 613711797319 613711973179 613717311979
613717973119 613719731179 613731171979 613731179719 613731197179 613731711979
613731797119 613731971179 613797117319 613797173119 613797311719 613797317119
617113197379 617113731979 617113797319 617119731379 617131197379 617137311979
617137973119 617197311379 617311371979 617311379719 617311971379 617313711979
617313797119 617319711379 617371131979 617371311979 617379711319 617379713119
617971137319 617971373119 617973113719 617973137119 617973711319 617973713119
619711317379 619711373179 619711731379 619713117379 619713731179 619717311379
619731137179 619731171379 619731371179 619731711379 619737113179 619737131179

DECLARE SUB addOn ()
DATA 11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97

DIM SHARED pr(21), s$, ct

CLS
FOR i = 1 TO 21
  READ pr(i): PRINT pr(i);
NEXT

PRINT

FOR i = 1 TO 21
  s$ = LTRIM$(STR$(pr(i)))
  REDIM SHARED used(21)
  used(i) = 1
  addOn
NEXT

PRINT

PRINT ct

SUB addOn
 IF LEN(s$) = 12 THEN PRINT s$; " "; : ct = ct + 1: EXIT SUB
 c$ = RIGHT$(s$, 1)
 FOR i = 1 TO 21
  IF used(i) = 0 THEN
   IF LEFT$(LTRIM$(STR$(pr(i))), 1) = c$ THEN
     s$ = s$ + RIGHT$(LTRIM$(STR$(pr(i))), 1)
     used(i) = 1
     addOn
     used(i) = 0
     s$ = LEFT$(s$, LEN(s$) - 1)
   END IF
  END IF
 NEXT i
END SUB

 


  Posted by Charlie on 2008-09-21 13:29:06
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 (23)
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