Menu
Coddy logo textTech

Introduction

Lesson 8 of 20 in Coddy's Mathematical Riddles course.

A Diophantine equation is an equation in which only integer solutions are allowed.

3x+5y=1 has many solutions. One of the solution is: x0=2, y0=-1. Other solutions can be found by adding fives to x0 and subtracting threes from y0. (x,y)=[(2,-1), (7,-4), (12,-7), ..., (-3,2), ...]. 

4x+2y=1 has no integer solutions, since the left side is even for any choice of integers and the right side is always odd.

9x+12y=4 has no integer solutions, since the left side is divisible by 3 and the right side isn't.

In general, one might need a special computer code to solve a given Diophantine equation.


Triangle, and hexagonal numbers are generated by the following formulae:

  • Triangle -  Tt=t(t+1)/2   1, 3, 6, 10, 15, ...
  • Hexagonal - Hh=h(2h−1)    1, 6, 15, 28, 45, ...

We see that T1=H1,  T3=H2 and T5=H3.

When is an hexagonal number equal triangle number?

 

We start with assuming that t is even, so we write: t=2t0.

Thus, we have to solve:
2t0(2t0+1)/2 = h(2h-1) => open brackets
2t02+t0 = 2h2-h => 
h+t0 = 2h2 - 2t02 = 2(h+t0)*(h-t0) => divide
1 = 2(h-t0) =>
0.5 = h-t0
this equation has NO integer solutions.
So, it must be odd.

Now assume, t = 2t1-1. Thus, we have to solve:
(2t1-1)*(2t1)/2 = h*(2h-1) => open brackets
t1*(2t1-1) = h*(2h-1) => t1 = h.

So, t = 2t1-1 = 2h-1 => T2h-1=Hh.

And this is the final answer.

Try it yourself

This lesson doesn't include a code challenge.

All lessons in Mathematical Riddles

5Diophantine Equation

IntroductionA problem