Ring my Bell, Ring my Bell

4 4 has the property that if one adds it to double its square, it yields a perfect square. In other words for natural numbers m , n m,n :

n 2 + n 2 + n = m 2 n^2 + n^2 + n = m^2

There are four such n < 1 0 6 n<10^6 . If 4 4 is the smallest n n , what is the second smallest n n ?


The answer is 144.

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.

11 solutions

Pi Han Goh
Mar 28, 2015

Pell's equation:

m 2 = 2 n 2 + n 4 m 2 = 8 n 2 + 4 n = 2 ( ( 2 n + 1 ) 2 ( 2 n + 1 ) ) , let p = 2 n + 1 = 2 p 2 p 16 m 2 = 2 ( 4 p 2 2 p ) = 2 ( ( 2 p 1 ) 2 1 ) 2 = 2 ( 2 p 1 ) 2 16 m 2 1 = ( 2 p 1 ) 2 8 m 2 = ( 4 n + 1 ) 2 8 ( m 2 ) \begin{aligned} m^2 & = & 2n^2 + n \\ 4m^2 & = & 8n^2 + 4n \\ & = & 2 ( (2n+1)^2 - (2n+1)), \text{ let } p = 2n+1 \\ & = & 2p^2 -p \\ 16m^2 & = & 2 (4p^2 - 2p) \\ & = & 2 ( (2p-1)^2 - 1) \\ 2 & = & 2(2p-1)^2 - 16m^2 \\ 1 & = & (2p-1)^2 - 8m^2 \\ & = & (4n+1)^2 - 8(m^2) \\ \end{aligned}

Knowing the two initial values n 1 = 4 m 1 = 6 n_1 = 4 \Rightarrow m_1 = 6 , we get the following pairs of ( n , m ) (n,m) less than 1 0 6 10^6 : ( 144 , 204 ) , ( 4900 , 6930 ) , ( 166464 , 235416 ) (144, 204),( 4900, 6930),(166464, 235416)

The second smallest n n is 144 \boxed{144}

Excellent way to manipulate equations

Rishik Jain - 5 years, 6 months ago

how did you get the remaining solutions from the base solution

shankar siva - 5 years, 3 months ago

Log in to reply

Expand the equation, x k + y k n = ( x 1 + y 1 n ) k x_k + y_k \sqrt n = (x_1 + y_1 \sqrt n)^k . You can read the wiki that is attached to this problem as well.

Pi Han Goh - 5 years, 3 months ago

Log in to reply

How can you determine other values by using the base values

Hari Rahul - 4 years, 10 months ago

Log in to reply

@Hari Rahul The wiki made it pretty clear. I want to find positive integer solutions for 1 = X 2 8 Y 2 1 = X^2 - 8Y^2 .

Pi Han Goh - 4 years, 10 months ago

There is a mistake in step 3

Michal Pecho - 2 years, 2 months ago

Log in to reply

Thank you for pointing this out. Fixed.

Pi Han Goh - 2 years, 2 months ago

It reduces to n(2n+1)=m^2. now from here it is clear that n must be a perfect square. so it becomes a Pell's Equation that b^2- 2 .a^2=1.,whose initial solutions are (b,a)=(3,2) where n=a^2 and m/n=b. the other solutions are given by (p,q) where (3+2 /2)^2=p+q /2,hence the next immediate solution is 2.3.2=12. Thank You

David Holcer
Mar 24, 2015
1
2
3
4
5
6
from math import *
nums=[]
for i in range(1,10**6+1):
    if sqrt((2*(i**2))+i).is_integer():
        nums.append(i)
print nums[1]

Python code

wolfram alpha input

solve 2n^2+n=m^2, 4<=n<10^6, m>0

= 4, 144, 4900, 166464

Harout G. Vartanian - 4 years, 3 months ago

Mathematica:

Solve[2 n^2 + n == m^2 && 0 < n < m < 1000000, {n, m}, Integers]

{{n -> 4, m -> 6}, {n -> 144, m -> 204}, {n -> 4900, m -> 6930}, {n -> 166464, m -> 235416}}

Giorgos K. - 3 years, 5 months ago
Audric Lebovitz
Nov 7, 2017

Here is a solution without Pell's using modular arithmetic.

It is clear n = 0 , 3 m o d 4. n=0, 3 \mod 4. We show n = 3 m o d 4 n=3 \mod 4 fails. Let n = 4 k + 3 n=4k+3 and then ( 4 k + 3 ) ( 8 k + 7 ) = m 2 . (4k+3)(8k+7)=m^2. Since ( 4 k + 3 ) (4k+3) is not a perfect square this implies g c d ( 4 k + 3 , 8 k + 7 ) > 1 gcd(4k+3, 8k+7)>1 which by Euclid is false, contradiction. So let n = 4 k n=4k and so 4 k ( 8 k + 1 ) . 4k(8k+1). We have k ( 8 k + 1 ) k(8k+1) a perfect square. By Euclid g c d ( k , 8 k + 1 ) = 1 gcd(k, 8k+1)=1 so k k is a perfect square. Simple testing gives us k = 1 , k = 36 k=1, k=36 as the smallest working solutions. We see n = 4 36 = 144. n=4 \cdot 36 = 144.

I did trial and error. :v

When I originally came up with the problem, I showed n had to be a perfect square and, as such, found the next solution pretty quickly. I'd narrowed down my possible values but it was still trial and error.

James Moors - 6 years, 8 months ago

I'm glad I didn't ask for the fourth value of n with this property.

James Moors - 6 years, 8 months ago

Well, at least you've been surprised when you tried 18...

Jeremy Bansil - 6 years, 8 months ago

I did that too :D

Justin Lee [STUDENT] - 2 years, 5 months ago
Carsten Meyer
Apr 30, 2020

Multiply both sides of the equation by 8, so we can complete the square on the LHS (left hand side) using integer coefficients: 2 n 2 + n = m 2 8 ( 4 n + 1 ) 2 1 = 2 ( 2 m ) 2 x 2 2 y 2 = 1 x : = 4 n + 1 > 0 , y : = 2 m 0 \begin{aligned} 2n^2+n&=m^2&&&\underset{\cdot 8}{\Leftrightarrow}&&&&(4n+1)^2 - 1 &= 2(2m)^2&&&\Leftrightarrow &&&&x^2-2y^2&=1&&&&\left|x:=4n+1>0,\quad y:=2m\geq0\right. \end{aligned} The vector x : = ( x , y ) T \vec{x}:=(x,\:y)^T satisfies Pell's equation, the non-negative solutions are x k : = ( x k , y k ) T \vec{x}_k:=(x_k,\:y_k)^T . The trivial solution is x 0 = ( 1 ; 0 ) T \vec{x}_0=(1;\:0)^T . Use continued fractions or simply guess the fundamental solution x 1 = ( 3 ; 2 ) T \vec{x}_1=(3;\:2)^T to get all other positive solutions x k \vec{x}_k in increasing order: x = ( ± x k ± y k ) , x k + 1 = ( 3 4 2 3 ) x k , x 0 = ( 1 0 ) \begin{aligned} \vec{x}&=\begin{pmatrix} \pm x_k\\ \pm y_k \end{pmatrix},&&&&&&&\vec{x}_{k+1}&=\begin{pmatrix} 3&4\\ 2&3 \end{pmatrix}\vec{x}_k,&&&\vec{x}_0&=\begin{pmatrix}1\\0\end{pmatrix} \end{aligned} We don't care about non-positive solutions, so we only need to consider x = x k \vec{x}=\vec{x}_k with k > 0 k>0 . Of those, only the ones that satisfy the condition " x k m o d 4 = 1 x_k\mod 4=1 " lead to integer values for n n . In iteration k = 4 k=4 we find the second smallest n N n\in\mathbb{N} : k 1 2 3 4 x k 3 17 99 577 y k 2 12 70 408 m 1 6 35 204 n 4 144 \begin{array}{r|r|r|r|r|r} k &1 & 2 & 3 & 4 &\cdots\\\hline x_k & 3 & 17 & 99 & 577 &\\ y_k & 2 & 12 & 70 & 408&\\\hline m & 1 & 6 & 35 & 204&\\ n & & 4 & & \boxed{144} & \end{array}


Rem.: With the recurrence relation for x k \vec{x}_k , it's possible to show that the relevant solutions with " x k m o d 4 = 1 x_k\mod 4 = 1 " are exactly the solutions with even k = 2 K > 0 k=2K>0 .

K T
Feb 12, 2019

Assume that for a given prime p p , n n is written as n = a p t n=ap^t , where p p does not divide a a .

We have 2 n 2 + n = 2 a 2 p 2 t + a p t = p t ( 2 a p t + a ) 2n^2+n=2a^2p^{2t}+ap^t=p^t(2ap^t+a) . We see that this expression is divisible by p t p^t , but not by p t + 1 p^{t+1} .

Since It is equal to the perfect square m 2 m^2 , t t must be even, and since this is the case for any p p , n n must be a perfect square.

We set n = k 2 n=k^2 .

We now have 2 k 4 + k 2 = m 2 2k^4+k^2=m^2 so that m m must be a multiple of k k

2 k 2 + 1 = ( m k ) 2 = u 2 2k^2+1=(\frac{m}{k})^2=u^2 . We see that u is odd.

2 k 2 = ( u + 1 ) ( u 1 ) 2k^2=(u+1)(u-1) is a multiple of 4, so k must be even. Set k = 2 v k= 2v to find

8 v 2 + 1 = u 2 8v^2+1=u^2

Now try a few values for v and see if 8 v 2 + 1 8v^2+1 is a perfect square:

v 8 v 2 + 1 8v^2+1 square? u n = 4 v 2 n=4v^2 m = 2 v u m=2vu
1 9 yes 3 4 6
2 33 no
3 73 no
4 129 no
5 201 no
6 289 yes 17 144 204

Check: 2 × 14 4 2 + 144 = 41616 = 20 4 2 2×144^2+144=41616=204^2 So we find n = 144 n=\boxed{144}

We could narrow the search further down by modular arithmetic: For example, if v 2 ( m o d 5 ) v \equiv 2 \pmod{5} then 8 v 2 + 1 3 8v^2+1\equiv 3 which is not in the set of squares { 0 , 1 , 4 } ( m o d 5 ) \{0,1,4\} \pmod{5} .

We find the conditions v { 0 , 1 , 4 } ( m o d 5 ) v \in \{0,1,4\} \pmod{5} v { 0 , 1 , 6 } ( m o d 7 ) v \in \{0,1,6\} \pmod{7} v { 0 , 1 , 2 , 5 , 6 , 9 , 10 } ( m o d 11 ) v \in \{0,1,2,5,6,9,10\} \pmod {11} v { 0 , 1 , 4 , 6 , 7 , 9 , 12 } ( m o d 13 ) v \in \{0,1,4,6,7,9,12\} \pmod {13} disqualifying over 90% of the candidates for v v .

Remaining candidates to check are then: v { 1 , 6 , 35 , 104 , 126 , 134 , 155 , 160 , 176 , 181 , 189 , 204 , . . . } v \in \{1,6,35,104,126,134,155,160,176,181,189,204,...\} of which 8 v 2 + 1 8v^2+1 is a square for v { 1 , 6 , 35 , 204 , . . . } v \in \{1,6,35,204,...\}

Remark: 0 0 is not considered a natural number in this problem, otherwise n = 0 n=0 would have been the smallest solution.

Dion Ho
Dec 14, 2017

Here is a solution without using the information of 4 being the smallest n n ,

2 n 2 + n = m 2 m = n 2 n + 1 2n^2 + n = m^2 \Rightarrow m = \sqrt{n}\sqrt{2n+1}

This implies that n n and 2 n + 1 2n+1 are a perfect squares.

Since 2 n + 1 2n+1 is a perfect square, let 2 n + 1 = k 2 , k Z 2n+1 = k^2, k \in \mathbb{Z} .

k 2 k^2 is obviously odd. Therefore, k k must be odd.

2 n + 1 = k 2 2 n = ( k + 1 ) ( k 1 ) 2n + 1 = k^2 \Rightarrow 2n = (k+1)(k-1) .

Since k k is odd, k + 1 k+1 and k 1 k-1 must be even. Therefore, n n must be even.

Since n n is an even perfect square, let n = 4 u 2 , u Z n = 4u^2, u \in \mathbb{Z} .

Therefore, 2 n + 1 = k 2 2 ( 4 u 2 ) + 1 = k 2 2n + 1 = k^2 \Rightarrow 2(4u^2) + 1 = k^2

Finally we end up with a classic Pell's equation: 1 = k 2 8 u 2 1 = k^2 - 8u^2 .

Solving the Pell's equation, the three smallest solutions ( k , u ) (k,u) are ( 1 , 0 ) (1,0) , ( 3 , 1 ) (3,1) , ( 17 , 6 ) (17,6) .

Therefore, the three smallest values of n n which satisfy 2 n 2 + n = m 2 2n^2 + n = m^2 are n = 0 n=0 (if you consider 0 0 a perfect square), n = 4 n=4 (given in the question), n = 144 n = \boxed{144} .

Scrub Lord
Aug 22, 2017

If you put m = n + k, you get:

n^2 - n(2k - 1) - k^2 = 0

The discriminant equals (2k - 1)^2 + 4k^2, which means

(2k - 1)^2 + (2k)^2 = E^2, where E is an integer.

The solution is easy to obtain using Euclid's formula for Pythagorean triplets (since (2k - 1) and 2k are consecutive integers), but I was way too lazy to do that so I just checked the list of the first few Pythagorean triples and found (119, 120, 169).

2k = 120, k = 60

n^2 - 119n - 3600 = 0

n = 144

Interesting idea - but if you multiply your discriminant by 2 to combine the two squares in k k , you end up with Pell's equation again: 2 E 2 = 2 ( 2 k 1 ) 2 + 2 ( 2 k ) 2 = ( 4 k 1 ) 2 + 1 x 2 2 E 2 = 1 , x : = 4 k 1 2E^2=2(2k-1)^2+2(2k)^2=(4k-1)^2+1\quad\rightarrow\quad x^2-2E^2=-1,\qquad x:=4k-1

Carsten Meyer - 1 year, 1 month ago
Arijit Dey
Jun 14, 2017

include<iostream>

include<stdio.h>

include<math.h>

using namespace std; int main() { long a,q; float s; for(a=0;a<=1000;a++) { q=a+2*(pow(a,2)); s=sqrt(q); if(s==floor(s)) cout<<a<<"\n"; } return 0; }

Aqil Shobri
Aug 20, 2018

n^2 + n^2 + n =n( 2 n +1 ) = m^2, so n is perfect square and n can divided by 2, so 2 n +1 is perfect square and m is can't divided by 2, due n is perfect square so 2 n +1 can be change to 2 a^2 +1 = b^2 , so (b+1)(b-1)= 2 a^2 ,so we get a is 2, 12 , etc so the smallest two is 12 and we get n is 144, thank you

How do you get a=12, by trial and error?

Maurice van Peursem - 2 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...