Difference between revisions of "2017 UNCO Math Contest II Problems/Problem 3"

(Created page with "== Problem == == Solution == == See also == {{UNCO Math Contest box|year=2017|n=II|num-b=2=First Question|num-a=4}} Category:Introductory Number Theory Problems")
 
(Solution)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Problem ==
 
== Problem ==
  
 +
Prime Mates
 +
 +
Find the largest 9 digit integer in which no two digits are the same and the
 +
sum of each pair of adjacent digits is prime. That is, the sum of the first two digits is prime,
 +
the sum of the second and third digits is prime, the sum of the third and fourth digits is prime,
 +
and so on.
  
 
== Solution ==
 
== Solution ==
 +
Since we want to maximize the integer, let's first start with <math>987,654,321</math>. Using a [[greedy algorithm]], we can do this series of changes (commas omitted):
 +
<cmath>(98)7654321</cmath>
 +
<cmath>9(85)764321</cmath>
 +
<cmath>98(56)74321</cmath>
 +
<cmath>985(67)4321</cmath>
 +
<cmath>9856(74)321</cmath>
 +
<cmath>985674(32)1</cmath>
 +
<cmath>9856743(21)</cmath>
 +
Thus the answer is <math>\boxed{985674321}</math> or <math>\boxed{985,674,321}</math>
  
 
== See also ==
 
== See also ==
{{UNCO Math Contest box|year=2017|n=II|num-b=2=First Question|num-a=4}}
+
{{UNCO Math Contest box|year=2017|n=II|num-b=2|num-a=4}}
  
 
[[Category:Introductory Number Theory Problems]]
 
[[Category:Introductory Number Theory Problems]]

Latest revision as of 21:26, 16 January 2023

Problem

Prime Mates

Find the largest 9 digit integer in which no two digits are the same and the sum of each pair of adjacent digits is prime. That is, the sum of the first two digits is prime, the sum of the second and third digits is prime, the sum of the third and fourth digits is prime, and so on.

Solution

Since we want to maximize the integer, let's first start with $987,654,321$. Using a greedy algorithm, we can do this series of changes (commas omitted): \[(98)7654321\] \[9(85)764321\] \[98(56)74321\] \[985(67)4321\] \[9856(74)321\] \[985674(32)1\] \[9856743(21)\] Thus the answer is $\boxed{985674321}$ or $\boxed{985,674,321}$

See also

2017 UNCO Math Contest II (ProblemsAnswer KeyResources)
Preceded by
Problem 2
Followed by
Problem 4
1 2 3 4 5 6 7 8 9 10
All UNCO Math Contest Problems and Solutions