Possible remainders of a square

Let

N = 3 × 5 × 7 × 11 × 13. N= 3 \times 5 \times 7 \times 11 \times 13.

There are X X possibilities for the units digit of a perfect square when it is represented in base N . N. Compute the last three digits of X X (in base 10).

Details and Assumptions:

  • We are talking about 3 , 5 , 7 , 11 , 13 3, 5, 7, 11, 13 in their decimal representations.
  • You might want to use the fact that 3 , 5 , 7 , 11 , 13 3, 5, 7, 11, 13 are all primes.


The answer is 8.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Harish Vemuri
Dec 15, 2013

First note that in base 10 10 , finding the X X possibilities for the units digit is the same thing as finding the number of quadratic residues modulo 10 10 . Similarly, finding the X X possibilities for the units digit in base N N is the same as finding the number of quadratic residues modulo N N . Now since N = 3 5 7 11 13 N=3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 , this is equivalent to the product of the number of quadratic residues in modulo 3 , 5 , 7 , 11 3,5,7,11 and 13 13 by the Chinese Remainder Theorem. It is well known that the number of quadratic residues mod p p is simply p + 1 2 \frac{p+1}{2} , so X = p = 3 , 5 , 7 , 11 , 13 p + 1 2 = 1008 008 ( m o d 1000 ) X=\displaystyle \prod_{p=3,5,7,11,13} \frac{p+1}{2}=1008 \equiv \boxed{008} \pmod{1000}

you ned to prove that the number of quadratic residues m o d p \mod{p} is indeed p + 1 2 \frac{p+1}{2}

Sagnik Saha - 7 years, 3 months ago

Log in to reply

let's take few cases:

  1. If prime 'p' is 3 ... any number under modulo '3' can be written as 3k or (3k ± 1) ... In which case the squares can be of the form 3k, or 3k + 1

  2. If the prime 'p' is 5, any number under modulo '5' can be written as 5k, (5k ± 1) or (5k ± 2) ... in which case the remainders are of the form 5k, (5k+1) or (5k + 4)

In order to generalize this, any number under modulo 'p' ( ODD primes ) can be written as ( p k ± r ) (p*k ± r) , where 'r' ranges from 0 0 to ( p 1 ) / 2 p-1)/2 :

Each of whose squares give different possibilities of remainders.

So, the various possibilities of quadratic residues for odd primes are: ( n + 1 ) / 2 {(n+1)}/{2}

Soumya Chakraborty - 7 years, 3 months ago
Kenny Lau
Sep 9, 2014

Number theory approach: Note that the question is asking for the possibilities of remainder when a perfect square is divided by N.

  • There are 2 possibilities of the remainder when a perfect square is divided by 3.
  • 3 when by 5.
  • 4 when by 7.
  • 6 when by 11.
  • 7 when by 13.

Therefore the answer is 2x3x4x6x7=1008.


Programming approach:

java code:

public class brilliant201409091623{
    public static void main(String[] args){
        boolean[] occur = new boolean[3*5*7*11*13];
        int count = 0;
        for(int i=0;i<3*5*7*11*13;i++){
            occur[i*i%(3*5*7*11*13)] = true;
        }
        for(int i=0;i<3*5*7*11*13;i++){
            if(occur[i]==true) count++;
        }
        System.out.println(count);
    }
}

output:

1008
Press any key to continue . . .

Note: I manually found the remainder when squares of 0 to 12 are divided by 13 to know that there are 7 possibilities. Numbers 13 or above would have a remainder the same as 13 less than that number.

Kenny Lau - 6 years, 9 months ago

Note: I note that the number of possibilities of remainder when a square is divided by p p is p + 1 2 \frac{p+1}2 .

Kenny Lau - 6 years, 9 months ago

Here note that the unit digit of the perfect square a^2 written in base N is just the remainder when a^2 is divided by N. Now, let A be the set of the possible remainders when a perfect square is divided by N. And let A {3}, A {5}, A {7}, A {11} and A {13} be the sets of the possible remainders when a perfect square is divided by 3, 5, 7, 11 and 13 respectively. Let B a set that is equal to A 3 \times A 5 \times A 7 \times A {11} \times A {13}. Now, the crux move is that you can get a one-to-one correspondence between the sets A and B. The possible remainders when a perfect square is divided by 3, 5, 7, 11 and 13 are 2, 3, 4, 6 and 7. So, the number of elements in B is 2 \times 3 \times 4 \times 6 \times 7 which is also the number of elements in A. So A has got 1008 elements and consequently the correct answer would be 008.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...