Prime time

What is the largest seven-digit number that contains each of the digits 1 through 7 and has the property that the sum of any two consecutive digits is a prime number?


The answer is 7652341.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Tushar Ahooja
Nov 12, 2015

Taking 7 we see that then the preceeding / proceeding digits with which sum is a prime number are 6,4

With 6 are 7,5,1

With 5 are 2,6

With 4 are 1,3,7

With 3 are 2,4

With 2 are 1,3,5

With 1 are 2,4,6

So our largest number starts with 7 then we have 6,4 we choose 6 as it is greater than 4

So 7 after this 6 then 5 then 2 then 3 then 4 then 1 So we finally get 7652341 Upvote if u like this

Jesse Nieminen
Aug 29, 2015

Add largest possible digit satisfying the condition to the end of the number.

That is how we get 7652341 as the answer.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...