- 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

# Show that one and only one out of $n, n + 4 , n + 8, n + 12$ and $n + 16$ is divisible by 5, where $n$ is any positive integer.

**Given: **

Numbers $n,\ n\ +\ 4,\ n\ +\ 8,\ n\ +\ 12$ and $n\ +\ 16$. $n$ is any positive integer.

**To do:**

We have to show that one and only one out of $n$, $n+4$, $n+8$, $n+12$ and $n+16$ is divisible by 5.

**Solution:**

Let $n\ =\ 5q\ +\ r$, where $0\ \underline{< }\ r\ <\ 5$.

So, $r\ =\ 0,\ 1,\ 2,\ 3,\ 4$.

If $r\ =\ 0$ then, $n\ =\ 5q$. So,

$n\ =\ 5q$, which is divisible by 5.

$n\ +\ 4\ =\ 5q\ +\ 4$, which is not divisible by 5.

$n\ +\ 8\ =\ 5q\ +\ 8$, which is not divisible by 5.

$n\ +\ 12\ =\ 5q\ +\ 12$, which is not divisible by 5.

$n\ +\ 16\ =\ 5q\ +\ 16$, which is not divisible by 5.

If $r\ =\ 1$ then, $n\ =\ 5q\ +\ 1$. So,

$n\ =\ 5q\ +\ 1$, which is not divisible by 5.

$n\ +\ 4\ =\ 5q\ +\ 1\ +\ 4\ =\ 5q\ +\ 5$, which is divisible by 5.

$n\ +\ 8\ =\ 5q\ +\ 1\ +\ 8\ =\ 5q\ +\ 9$, which is not divisible by 5.

$n\ +\ 12\ =\ 5q\ +\ 1\ +\ 12\ =\ 5q\ +\ 13$, which is not divisible by 5.

$n\ +\ 16\ =\ 5q\ +\ 1\ +\ 16\ =\ 5q\ +\ 17$, which is not divisible by 5.

If $r\ =\ 2$ then, $n\ =\ 5q\ +\ 2$. So,

$n\ =\ 5q\ +\ 2$, which is not divisible by 5.

$n\ +\ 4\ =\ 5q\ +\ 2\ +\ 4\ =\ 5q\ +\ 6$, which is not divisible by 5.

$n\ +\ 8\ =\ 5q\ +\ 2\ +\ 8\ =\ 5q\ +\ 10$, which is divisible by 5.

$n\ +\ 12\ =\ 5q\ +\ 2\ +\ 12\ =\ 5q\ +\ 14$, which is not divisible by 5.

$n\ +\ 16\ =\ 5q\ +\ 2\ +\ 16\ =\ 5q\ +\ 18$, which is not divisible by 5.

If $r\ =\ 3$ then, $n\ =\ 5q\ +\ 3$. So,

$n\ =\ 5q\ +\ 3$, which is not divisible by 5.

$n\ +\ 4\ =\ 5q\ +\ 3\ +\ 4\ =\ 5q\ +\ 7$, which is not divisible by 5.

$n\ +\ 8\ =\ 5q\ +\ 3\ +\ 8\ =\ 5q\ +\ 11$, which is not divisible by 5.

$n\ +\ 12\ =\ 5q\ +\ 3\ +\ 12\ =\ 5q\ +\ 15$, which is divisible by 5.

$n\ +\ 16\ =\ 5q\ +\ 3\ +\ 16\ =\ 5q\ +\ 19$, which is not divisible by 5.

If $r\ =\ 4$ then, $n\ =\ 5q\ +\ 4$. So,

$n\ =\ 5q\ +\ 4$, which is not divisible by 5.

$n\ +\ 4\ =\ 5q\ +\ 4\ +\ 4\ =\ 5q\ +\ 8$, which is not divisible by 5.

$n\ +\ 8\ =\ 5q\ +\ 4\ +\ 8\ =\ 5q\ +\ 12$, which is not divisible by 5.

$n\ +\ 12\ =\ 5q\ +\ 4\ +\ 12\ =\ 5q\ +\ 16$, which is not divisible by 5.

$n\ +\ 16\ =\ 5q\ +\ 4\ +\ 16\ =\ 5q\ +\ 20$, which is divisible by 5.

Hence, in each case, only one out of $n,\ n\ +\ 4,\ n\ +\ 8,\ n\ +\ 12$ and $n\ +\ 16$ is divisible by 5.

- Related Questions & Answers
- Finding all possible combined (plus and minus) sums of n arguments JavaScript
- Plus One in Python
- What are the specifications of one plus 5?
- Find (1^n + 2^n + 3^n + 4^n) mod 5 in C++
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n in C++
- Plus One Linked List in C++
- Print first k digits of 1/n where n is a positive integer in C Program
- What are the specifications of one plus 3T phone?
- Construct Deterministic PDA for a^n b^n where n>=1
- Sum which is divisible by n in JavaScript
- Count divisors of n that have at-least one digit common with n in Java
- Generating a random number that is divisible by n in JavaScript
- Smallest number that is divisible by first n numbers in JavaScript
- What is the Cost plus pricing method?
- Find n-variables from n sum equations with one missing in C++
- Find a positive number M such that gcd(N^M,N&M) is maximum in Python