Skip to main content

Cyclicity of Numbers

Important Concepts and Shortcuts of Cyclicity of Numbers

Types of questions based on cyclicity of numbers
There are mainly 3 categories of questions which fall under cyclicity of numbers, that include
  1. How to find units digit of ab
  2. How to find units digit of ab * cd * ef
  3. How to find units digit of abc
Let's see how to solve these questions using the concept of cyclicity of numbers, with examples.

Find units digit of ab

Given ab, units place digit of the result depends on units place digit of a and the divisibility of power b.
Consider powers of 2
As we know,
21 =2
22 = 4
23 = 8
24 = 16
25 = 32
26 = 64
27 = 128.. and so on
What do you observe here? We can see that the units place digit for powers of 2 repeat in an order: 2, 4, 8, 6. So the "cyclicity" of number 2 is 4 (that means the pattern repeats after 4 occurrences) and the cycle pattern is 2, 4, 8, 6. From this you can see that to find the units place digit of powers of 2, you have to divide the exponent by 4.

Let's check the validity of above formula with an example.

  • Find the units place digit of 299?
Using the above observation of cyclicity of powers of 2, divide the exponent by 4. 99/4 gives reminder as 3. That means, units place digit of 299 is the 3rd item in the cycle which is 8.

Shortcuts to solve problems related to units place digit of ab
  • Case 1: If b is a multiple of 4
    • If a is an even number, ie: 2, 4, 6 or 8 then the units place digit is 6
    • If a is an odd number, ie: 1, 3, 7 or 9 then the units place digit is 1
  • Case 2: If b is not a multiple of 4
    • Let r be the reminder when b is divided by 4, then units place of ab will be equal to units place ofar
Let's call it the general rule of cyclicity. Using these rules you can solve all the problems related to cyclicity of numbers.

Here we have captured the cyclicity of numbers upto 9 in the below table.

Find units digit for numbers of the form ab * cd

Question of this type is similar to first category.
  • First find the unit digit of ab and cd separately. Let the answers be x and y
  • Then unit digit of ab * cd = units digit of x * y

Find units digit of abc

Questions of this type have to be approached on a case by case basis.
  • Case 1: If cyclicity of units place digit of a is 4 then we have to divide the exponent of a by 4 and find out the remainder. Depending on the value of remainder we can apply the general rule of cyclicity given above and reach the solution.
  • Case 2: If cyclicity of units place digit of a is 2, only extra information we need to find is if the exponent will be even or odd. Then we can apply the general rule of cyclicity given above and reach the solution.
Let's see application of these rules with help of examples

Example 1:
  • Find the units place digit of 24344
  1. Here cyclicity of units place digit is 4 (Units place digit is 2, from the above table we can see the cyclicity of 2 is 4). Hence case 1 is applicable.
  2. Now we have to find the remainder when exponent of 2 is divided by 4, that is the remainder when 4344 is divided by 4.
  3. Remainder of 4344/4 = Remainder of (44 – 1)44/4
  4. Using the binomial theorem, (as explained in number system tutorial) we can see that there is only one term in the expansion of (44 – 1)44 which is not divisible by 4.
  5. The term is 144/4
  6. Remainder of 144/4 = 1
  7. Now we can apply the general rules of cyclicity, (since reminder is 1, case 2 of general rule of cyclicity is applicable) which says, units place of 24344 = units place of 21 = 2.
Example 2:
  • Find the units place digit of 293945
  1. Here cyclicity of units place digit of a, that is cyclicity of 9 is 2. Hence case 2 is applicable
  2. Next step is we need to find if 3945 is even or odd 
  3. 3945 will always result in an odd number, because we are multiplying an odd number 39, odd number of times (45).
  4. Now we can apply the general rule of cyclicity described in the first section. General rule says, first check if exponent is divisible by 4. Since the exponent here is odd, it's not divisible by 4.
  5. Again according to general rule, if exponent is not divisible by 4, find the reminder when exponent is divided by 4.
  6. Since the exponent is odd here, the possible reminders when it's divided by 4 are 1 and 3.
  7. This means, the units place digit of number will be 1st or 3rd element in the cyclicity of units place digit of a.
In this case 1st and 3rd elements of 9 (units place digit of 29) is 9.
Hence units place digit of 2293945 is 9.


Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

C Questions

C Questions
C Questions

Note : All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
Programs run under DOS environment, The underlying machine is an x86 system, Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:

void main()
int const * p=5; printf("%d",++(*p));
Compiler error: Cannot modify a constant value.
p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".
char s[ ]="man"; int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
Answer: mmmm
aaaa nnnn

Zoho Interview | Set 1 (Advanced Programming Round)

Third Round: (Advanced Programming Round) Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
    1. Booking
    2. Availability checking
    3. Cancellation
    4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.

 My Solution :

#include<stdio.h>#include<conio.h>#include<stdlib.h>#include<string.h>#include<iostream.h>#include<time.h>#include<iomanip.h>#include<fstream.h>char f[10]="f";char s[10]="s";int addr,ad,flag,f1,d,m,i,amt;float tamt; class login {public:char id[100];char pass[100];char*password;void getid(){ cout<<"Enter your id:";gets(id); password=getpass("Enter the password:");strcpy(pass,password);}void displayid(){ cout<<"Id:";puts(id); cout<<"Password:";puts(pass);}}; class detail {public:in…