Last Digits In Base 18815

Let X X be the number of distinct possibilities for the units digit of a perfect cube when written in base 18815 18815 . Find the last three digits of X X (in decimal base).

Details and assumptions

  • The prime factorization of 18815 18815 is 18815 = 5 × 53 × 71 18815= 5 \times 53 \times 71 .

  • We're talking about 18815 18815 in its decimal representation.

  • This problem is similar to this one.


The answer is 815.

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.

2 solutions

First, note that the units digit of a number in base x x is simply its remainder when divided by x x . The problem simply asks for the number of distinct cubic residues modulo 18815 18815 .

The key observation here is that all prime factors of 18815 18815 are 2 ( m o d 3 ) \equiv 2 \pmod{3} .


*Lemma: * If x 3 y 3 ( m o d p ) x^3 \equiv y^3 \pmod{p} for some integers x , y x,y and a prime p 2 ( m o d 3 ) p \equiv 2 \pmod{3} , then x y ( m o d p ) x \equiv y \pmod{p} .

*Proof: * First, note that if x 0 ( m o d p ) x \equiv 0 \pmod{p} , then y 3 0 ( m o d p ) y 0 ( m o d p ) y^3 \equiv 0 \pmod{p} \implies y \equiv 0 \pmod{p} . Now let x , y ≢ 0 ( m o d p ) x,y \not \equiv 0 \pmod{p} . Assume x y ( m o d p ) x \neq y \pmod{p} , so gcd ( p , x y ) = 1 \gcd (p, x-y)=1 and p x 3 y 3 p ( x y ) ( x 2 + x y + y 2 ) p x 2 + x y + y 2 ( x y 1 ) 2 + ( x y 1 ) + 1 0 ( m o d p ) Φ 3 ( x y 1 ) 0 ( m o d p ) , p|x^3-y^3 \implies p|(x-y)(x^2+xy+y^2) \implies p|x^2+xy+y^2 \\ \implies \left( xy^{-1} \right) ^2 + \left( xy^{-1} \right) + 1 \equiv 0 \pmod{p} \implies \Phi_3 \left( xy^{-1} \right) \equiv 0 \pmod{p}, where Φ 3 \Phi_3 is the third cyclotomic polynomial ( Φ 3 ( z ) = z 2 + z + 1 ) \left( \Phi_3 (z) = z^2+z+1\right) . This implies either p = 3 p=3 or 3 p 1 3|p-1 , none of which is the case since p 2 ( m o d 3 ) p \equiv 2 \pmod{3} . \blacksquare


By the lemma, modulo p p , the set { 0 3 , 1 3 , 2 3 , , ( p 1 ) 3 } \left \{ 0^3, 1^3, 2^3, \cdots , (p-1)^3 \right \} is equivalent to { 0 , 1 , 2 , , p 1 } \{0, 1, 2, \cdots , p-1 \} modulo p p whenever p p is a prime and p 2 ( m o d 3 ) p \equiv 2 \pmod{3} , so the number of cubic residues modulo p p is p p . Thus, modulo 5 , 53 , 71 , 5, 53, 71, the number of cubic residues are 5 , 53 , 71 5, 53, 71 respectively.

Now, we have to find the number of cubic residues modulo 18815 18815 . Let a i , b i , c i a_i, b_i, c_i be any three cubic residues modulo 5 , 53 , 71 5, 53, 71 respectively. Let x 3 x^3 be an arbitrary cube. Consider the congruency system x 3 a i ( m o d 5 ) x 3 b i ( m o d 53 ) x 3 c i ( m o d 71 ) . \begin{array}{lcl} x^3 \equiv a_i \pmod{5} \\ x^3 \equiv b_i \pmod{53} \\ x^3 \equiv c_i \pmod{71}. \end{array} By CRT, each of these congruency systems give rise to a unique solution modulo 18815 18815 . Conversely, for any cubic residue r r modulo 18815 18815 , there exist unique a i , b i , c i a_i, b_i, c_i such that whenever x 3 x^3 is a solution to the above congruency, x 3 r ( m o d 18815 ) x^3 \equiv r \pmod{18815} . Since a i , b i , c i a_i, b_i, c_i can take 5 , 53 , 71 5, 53, 71 values respectively, the number of cubic residues modulo 18815 18815 is 5 × 53 × 71 = 18815 5 \times 53 \times 71= 18815 , whose last three digits in decimal base are 815 \boxed{815} .


This problem was inspired by v_Enhance's solution to Iran TST 2013 Set 1 Day 2 Problem 5 .

EDIT: The lemma can also be proven without cyclotomic polynomials. Darn, I'm stupid. Anyways, note that a 3 b 3 ( m o d p ) a^3 \equiv b^3 \pmod{p} gives ( a b 1 ) 3 1 ( m o d p ) \left( ab^{-1} \right) ^3 \equiv 1 \pmod{p} , so the order of a b 1 ( m o d p ) ab^{-1} \pmod{p} is either 1 1 or 3 3 . But since p 2 ( m o d 3 ) p \equiv 2 \pmod{3} , φ ( p ) 1 ( m o d 3 ) \varphi (p) \equiv 1 \pmod{3} , so the order cannot be 3 3 . It follows that a b 1 1 ( m o d p ) a b ( m o d p ) , ab^{-1} \equiv 1 \pmod{p} \implies a \equiv b \pmod{p}, which is what we wanted. \blacksquare

Sreejato Bhattacharya - 7 years, 2 months ago
Kenny Lau
Sep 9, 2014

java code:

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

output:

18815
Press any key to continue . . .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...