- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies

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

# If $n$ is an odd integer, then show that $n^2 - 1$ is divisible by $8$.

Given:

$n$ is an odd integer.

To do:

We have to show that $n^2 - 1$ is divisible by $8$.

Solution:

Let $a = n^2 - 1$ where $n$ can be even or odd.

When $n$ is even,

$n = 2k$, where $k$ is an integer.

This implies,

$a = (2k)^2 - 1$

$a = 4k^2 - 1$

For $k = -1$,

$a = 4(-1)^2 - 1$

$= 4 - 1$

$= 3$ which is not divisible by 8.

For $k = 0$,

$a = 4(0)^2 - 1$

$= 0 - 1$

$= -1$, which is not divisible by 8.

When $n$ is odd, $n = 2k + 1$, where $k$ is an integer,

This implies,

$a = (2k+1)^2-1$

$=4k^2+4k+1-1$

$=4k^2+4k$

$=4k(k+1)$

For $k = 1$,

$a=4(1)(1 + 1)$

$= 8$ which is divisible by 8.

Hence, we can conclude from the above two observations that if $n$ is odd, then $n^2 - 1$ is divisible by 8.

- Related Questions & Answers
- Check if n is divisible by power of 2 without using arithmetic operators in Python
- Count of m digit integers that are divisible by an integer n in C++
- Generating a random number that is divisible by n in JavaScript
- Smallest number that is divisible by first n numbers in JavaScript
- Sum which is divisible by n in JavaScript
- Sum of the series Kn + ( K(n-1) * (K-1)1 ) + ( K(n-2) * (K-1)2 ) + ... (K-1)n in C++
- Largest number with the given set of N digits that is divisible by 2, 3 and 5 in C++
- Find (1^n + 2^n + 3^n + 4^n) mod 5 in C++
- Sum of series 1^2 + 3^2 + 5^2 + . . . + (2*n – 1)^2
- Add N digits to A such that it is divisible by B after each addition?
- Find sum of Series with n-th term as n^2 - (n-1)^2 in C++
- Sum of the series 1^1 + 2^2 + 3^3 + ... + n^n using recursion in C++
- Find N digits number which is divisible by D in C++
- Find permutation of n which is divisible by 3 but not divisible by 6 in C++
- Check if product of first N natural numbers is divisible by their sum in Python
- C++ program to find the sum of the series 1 + 1/2^2 + 1/3^3 + …..+ 1/n^n

Advertisements