- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Find two consecutive positive integers, sum of whose squares is 365.

Given:

Two consecutive numbers whose squares have the sum 365.

To do:

We have to find the two numbers.

Solution:

Let the two consecutive numbers be $x$ and $x+1$.

This implies,

$x^2+(x+1)^2=365$

$x^2+x^2+2x+1=365$ (Since $(a+b)^2=a^2+2ab+b^2$)

$2x^2+2x+1-365=0$

$2x^2+2x-364=0$

$2(x^2+x-182)=0$

$x^2+x-182=0$

Solving for $x$ by factorization method, we get,

$x^2+14x-13x-182=0$

$x(x+14)-13(x+14)=0$

$(x+14)(x-13)=0$

$x+14=0$ or $x-13=0$

$x=-14$ or $x=13$

If $x=13$, $x+1=13+1=14$

The two consecutive positive integers are $13$ and $14$.

- Related Questions & Answers
- Number of arrays of size N whose elements are positive integers and sum is K in C++
- Is a number sum of two perfect squares in JavaScript
- Program to find number of consecutive subsequences whose sum is divisible by k in Python
- Ways to write N as sum of two or more positive integers in C++
- Sum of Two Integers in Python
- Minimum number of squares whose sum equals to given number n
- Program to count number of consecutive lists whose sum is n in C++
- Program to find the sum of the lengths of two nonoverlapping sublists whose sum is given in Python
- Find Nth positive number whose digital root is X in C++
- Count pairs (a, b) whose sum of squares is N (a^2 + b^2 = N) in C++
- C++ program to find two numbers from two arrays whose sum is not present in both arrays
- Find two numbers whose sum and GCD are given in C++
- Program to find sum of k non-overlapping sublists whose sum is maximum in C++
- C++ code to find three numbers whose sum is n
- Find numbers whose sum of digits equals a value
- Finding clusters of consecutive negative integers in JavaScript

Advertisements