- #1
Acquirer
- 3
- 0
A number(p) is given. now p is appended to itself n times(n can be
as large as 10^10). I need to find the number thus formed modulo m.
Let the number be 12 and n be 4.
so number thus formed is 12121212. let us find this number modulo 11
then the ans is 4.
On observing the pattern it is clear that the modulo value starts repeating for some value of n.
let p=12 and m=7,
for n=1, mod= 5
for n=2,mod= 1
for n=3,mod=0
for n=4 onwards the same mod i.e. 5,1,0 starts repeating.but the problem is for many values of p and m the repitition starts after a large value of n thus making it difficult to calculate.
So, there should be an easier method for this maybe some more reliable pattern or formula. Pls help.
as large as 10^10). I need to find the number thus formed modulo m.
Let the number be 12 and n be 4.
so number thus formed is 12121212. let us find this number modulo 11
then the ans is 4.
On observing the pattern it is clear that the modulo value starts repeating for some value of n.
let p=12 and m=7,
for n=1, mod= 5
for n=2,mod= 1
for n=3,mod=0
for n=4 onwards the same mod i.e. 5,1,0 starts repeating.but the problem is for many values of p and m the repitition starts after a large value of n thus making it difficult to calculate.
So, there should be an easier method for this maybe some more reliable pattern or formula. Pls help.