Brilli the ant is considering the complexities of a 5-dimensional universe. She wants to count the number of integer points that are distance n away from the origin. Let T n be the set of ordered 5-tuples of integers ( a 1 , a 2 , a 3 , a 4 , a 5 ) such that a 1 2 + a 2 2 + a 3 2 + a 4 2 + a 5 2 = n . However, being an ant, she doesn't have enough toes to record numbers that are above 10. Let D n be the units digit of ∣ T n ∣ .
Determine ∑ i = 1 5 6 7 8 D i .
Details and assumptions
Note: You are not asked to find the last digit of the sum, but the sum of all the last digits.
For a set S , ∣ S ∣ denotes the number of elements in S . You can read up on set notation .
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.
Consider the correspondence ( a 1 , a 2 , a 3 , a 4 , a 5 ) → ( b 1 , b 2 , b 3 , b 4 , b 5 ) for a 1 2 + a 2 2 + a 3 2 + a 4 2 + a 5 2 = n where a i 2 = b i . Consider some set ( b 1 , b 2 , b 3 , b 4 , b 5 ) where for some i = 1 , 2 , 3 , 4 , 5 , i of the b k are equal to some value a . Then there are ( i 5 ) ways to choose the b k that are equal, multiplied by 2 i ways to choose the signs of the corresponding a k (due to a k being allowed to be either the positive or negative squareroot of b k ), and then multiplied by the number of ways to write n − i a as a sum of 5 − i squares (let this be c ). Then the number of such sets is clearly divisible by 1 0 , as the number of such sets is ( i 5 ) 2 i c which is both even and a multiple of 5 for 1 ≤ i ≤ 4 . Therefore these kinds of sets make no contribution to the last digit of ∣ T n ∣ and thus no contribution to D n .
Thus, it suffices to consider only those sets in which all of the b k are equal. Then n is of the form 5 a 2 , and each b k is equal to a 2 , which means that the a k are equal to ± a . There are 2 5 = 3 2 ways to choose the arrangement of possible signs, which means the number of such sets for this form of n is equal to 3 2 . So then ∣ T n ∣ = 1 0 k + 3 2 for some k , which means that D n = 2 .
It hence follows that if n is not of the form 5 a 2 , then D n = 0 , and otherwise D n = 2 . Thus, it suffices to find the number of such n . The number of integers of the form 5 a 2 under 5 6 7 8 is equal to ⌊ 5 5 6 7 8 ⌋ = 3 3 , and so we have k = 1 ∑ 5 6 7 8 D n = 2 ⋅ 3 3 = 6 6
Suppose a 2 + b 2 + c 2 + d 2 + e 2 = n . This means that any permutation of ( ± a , ± b , ± c , ± d , ± e ) is a valid solution and is thus present in T n . Since at least one of a , b , c , d , e is non-zero, + a i = − a i for some element and thus the number of permutations is even, implying that ∣ T n ∣ is even.
Now, consider only the case when the elements which are ≥ 0 . How many permutations of ( a , b , c , d , e ) are distinct? The answer is ∏ k m k 5 ! where m k s are the multiplicities of elements (For example, ( a , a , a , b , b ) has multiplicities 3 and 2). We note that this number is a multiple of 5 unless all elements are equal. This when compounded with the earlier result that the cardinality is even (flip the sigh of every number and we get another solution), we get that the number of solutions is a multiple of 10 unless the solution is of the type ( ± a , ± a , ± a , ± a , ± a ) .
So we just count the number of such solutions. 5 × 3 3 2 ≤ 5 6 7 8 ≤ 5 × 3 4 2 . Hence we have 33 values of ∣ a ∣ . For each value of ∣ a ∣ , there are 32 solutions when we consider the signs of all 5 elements. Hence the unit's digit contribution is 2. So the required answer is 3 3 × 2 = 6 .
Every solution \( (x,y,z,q,w) \) of the equation \( x^2+y^2+z^2+q^2+w^2=n \) has a root solution \( (a,b,c,d,e) \) such that \( a^2+b^2+c^2+d^2+e^2=n \) such that \( |x|=a, |y|=b, |z|=c, |p|=d, |w|=e \) .
Then, because the order of the letters also matters, the number of solutions \( (x,y,z,q,w) \) that have as root solution \( (a,b,c,d,e) \) can be counted.
That means that if we define a root solution \( (a,b,c,d,e) \) as a vector composed of nonegative integrers such that \( a \geq b \geq c \geq d \geq e \), it can be generated new solutions permutating the order of the coordinates and their signs.
The number of permutation of the coordinates depends of how many numbers are equal in the vector \( (a,b,c,d,e) \). If all numbers are distinct, the number of permutations is \( 5! \).I If \( a=b\), \( c=d=e \), the number of permutations is \( \frac {5!}{2! 3!} \) If \( a=b \), \( c=d \), its \( \frac {5!}{2! 2! 1!} \)
In general the numbers are of the form \( \frac {5!}{m!n!...} \) And because \( m,n,... <5 \), the result is multiple of \( 5 \).
Also, considering that if \( (a,b,c,d,e) \) is a solution for \( n \) is impossible that \( a=b=c=d=e=0 \), at least you can double the number of solutions by changing signs of the original vector. For example \( (10,7,5,5,2) \) is equivalent to \( (-10,7,5,5,2) \)
As we can see, the number of solutions that have as root solution \( (a,b,c,d,e) \) is multiple of \( 2 \) and \( 5 \) and because of it, \( 10 \).
The only way to avoid this is that \( a=b=c=d=e \) because the number of permutations of this is \( 1 \). Then, if \( (a,a,a,a,a) \) is a solution, there are \( 2^5 \) different solutions changing signs. If \( (a,a,a,a,a) \) is solution to n, then \( 5a^2=n < 5679 \) \( a^2 < 1135.8 < 1156 < 34^2 \) \( a < 34 \)
So, only caring about unit digit, the only numbers that care are the solutions \( (a,a,a,a,a) \) for \( n=5m^2 \) with \( m \) from \( 1 \) to \( 33 \). \( 2^5=32 \) so \( D_{5m^2}=2 \) So the total sum is \( 2*33=66 \).
Denote T n = A n ∪ ( T n ∖ A n ) where A n c : = T n ∖ A n = { a ∈ T n ∣ a 1 = a 2 = a 3 = a 4 = a 5 } .
Claim: ∣ A n ∣ is divisible by 1 0 for all naturals n .
Proof: Pick any vector a in A n whose co-ordinates are in non-decreasing order. Observe that all 5 cyclic permutations of a are distinct, for this case, and they all belong to A n . Further we can get 5 more solutions by running this argument for − a . Thus for every solution ± a in non-decreasing order, we can generate 1 0 solutions. Also note that the ten solutions generated for two different non-decreasing vectors (upto a -sign) is different. Further, every solution is some permutation of it's non-decreasing order. Thus we have partitioned A n into disjoint sets of 10 vectors each. This means that 10 divides ∣ A n ∣ for every n . Q.E.D.
Therefore ∣ D n ∣ = ∣ A n ∣ + ∣ A n c ∣ = ∣ A n c ∣ m o d 1 0
Any vector in A n c is of the form ( k , k , k , k , k ) and therefore 5 k 2 = n . There are two cases:
1) If n is not of the form 5 k 2 , A n c is empty and therefore ∣ D n ∣ = 0 m o d 1 0 .
2) If n = 5 k 2 , then there are two vectors, viz. ( k , k , k , k , k ) and − ( k , k , k , k , k ) in A n c and therefore D n = 2 m o d 1 0 .
Now 1 ≤ 5 k 2 ≤ 5 ⋅ 3 3 2 < 5 6 7 8 and thus D n contributes 3 3 twos to the sum ∑ i = 1 5 6 7 8 D i and therefore the answer is 66.
For a particular 'n' let ( a 1 , a 2 , a 3 , a 4 , a 5 ) be an ordered pair satisfying a 1 2 + a 2 2 + a 3 2 + a 4 2 + a 5 2 = n
We know that all permutations of ( a 1 , a 2 , a 3 , a 4 , a 5 ) will also satisfy a 1 2 + a 2 2 + a 3 2 + a 4 2 + a 5 2 = n
Case -1(If all a i s are distinct)
From the given ordered pair ( a 1 , a 2 , a 3 , a 4 , a 5 ) we can obtain 5 ! ordered pairs (including the one used) by permuting a 1 , a 2 , a 3 , a 4 , a 5 in 5 places.
Case -2(If 2 a i s are identical, rest are distinct)
From the given ordered pair we can get ( 2 5 ) × 3 ! ordered pairs (including the one used) by permuting a 1 , a 2 , a 3 , a 4 , a 5 in 5 places.
Case-3(If there exist 2 pairs of a i which are not identical, both contain the same numbers and the other number is not equal to the numbers in any of the pairs)
From the given ordered pair we can create ( 2 5 ) × ( 2 5 ) ordered pairs (including the original one) by permuting a 1 , a 2 , a 3 , a 4 , a 5 in 5 places.
Case-4(If 3 a i s are identical and other 2 are distinct)
Using the given ordered pair we can obtain ( 2 5 ) × 2 ! ordered pairs(including the original one).
Case-5(If there exists a triplet and a pair of a i s each containing equal numbers and the numbers in the triplet not being equal to the numbers in the pair)
Using the given ordered pair we can obtain ( 2 5 ) ordered pairs(including the original one).
Case-6(If 4 a i s are identical and the fifth one is distinct from the rest 4)
Similarly here, we can construct ( 4 5 ) ordered pairs from the given one.
Case-7(If all a i s are identical)
Here we can construct only 1 ordered pair(i.e the original one).
Now note that in cases 1-5 the number of ordered pairs obtained by permutation is a multiple of 5.
Let us look at cases 6 and 7 more closely.
Case-6(revisited)
If ( a 1 , a 2 , a 3 , a 4 , a 5 ) is a solution then we can obtain more ordered pairs by reversing the sign of some or all the a i s.
Considering the cases:-
(i)All the a i s are non 0.
(ii)4 of the a i s are 0, the other is non zero
(iii)1 a i is 0, others are non-zero
In each of the above sub cases we have to multiply a multiple of 2 to get more ordered pairs.
Case-7(revisited)
All a i s must be non-zero according to the question.
Here we can get 2 5 ordered pairs(including the original one).
Now, it is clear that for all n that cannot be expressed as 5 × k 2 (where k is a positive integer) the number of ordered pairs is a multiple of 10. D n = 0 for all such n.
There are 33 numbers less than 5678 which can be expressed as 5 × k 2
So, our answer will be 3 3 × 2 which is 66.
Let σ ( a , b , c , d , e ) = ( − e , − a , − b , − c , − d ) . Note that σ 1 0 is the identity and that σ preserves distance from the origin. The group G generated by σ acts on T n , so it partitions T n into orbits of size 1 0 / m where m is the size of the stabilizer of an element in the orbit.
If m = 1 then the orbit has size 1 0 .
If m = 2 then σ 5 x = x for all x in the orbit, but σ 5 x = − x so x is the all-zeroes vector, which is impossible for n > 0 , so there are no orbits of size 5 .
If m = 5 then σ 2 ( a , b , c , d , e ) = ( a , b , c , d , e ) for all ( a , b , c , d , e ) in the orbit, so ( d , e , a , b , c ) = ( a , b , c , d , e ) , so a = b = c = d = e . This is possible only if n = 5 a 2 , in which case there is exactly one orbit of size 2 , consisting of ( a , a , a , a , a ) and ( − a , − a , − a , − a , − a ) .
If m = 1 0 then σ x = x for all x in the orbit, but then σ 5 x = x , which we have seen above is impossible for n > 0 . So there are no orbits of size 1 .
Putting it all together, we see that D n = 2 if n = 5 a 2 for some integer a and D n = 0 otherwise. There are 3 3 positive values of n ≤ 5 6 7 8 that satisfy n = 5 a 2 (since 5 ( 3 3 ) 2 ≤ 5 6 7 8 ≤ 5 ( 3 4 ) 2 ), so the sum is 2 ⋅ 3 3 = 6 6 .
If a 1 2 + a 2 2 + a 3 2 + a 4 2 + a 5 2 = n then a 2 2 + a 3 2 + a 4 2 + a 5 2 + a 1 2 = n and ( − a 1 ) 2 + ( − a 2 ) 2 + ( − a 3 ) 2 + ( − a 4 ) 2 + ( − a 5 ) 2 = n . These generate a group of order 10. If a solution has no symmetries, then the orbit under the group has size 10, and together these have no effect on the units digit of D n .
For a solution to have an orbit of size less than 10, it must be of the form a 1 = a 2 = a 3 = a 4 = a 5 . For each n of the form 5k^2 with k > 0 , there are two of these, a 1 = k and a 1 = − k , so D 5 k 2 = 2 . Since ⌊ 5 6 7 8 / 5 ⌋ = 3 3 , ∑ i = 1 5 6 7 8 D i = 2 ∗ 3 3 = 6 6 .
We claim that D n = 2 when n = 5 k 2 and D n = 0 otherwise. For each element ( a 1 , a 2 , a 3 , a 4 , a 5 ) of T n , we consider the unordered multi-set { ∣ a 1 ∣ , ∣ a 2 ∣ , ∣ a 3 ∣ , ∣ a 4 ∣ , ∣ a 5 ∣ } .
If the a i values are not all the same, then the number of ways of ordering the elements ∣ a 1 ∣ , ∣ a 2 ∣ , ∣ a 3 ∣ , ∣ a 4 ∣ , ∣ a 5 ∣ to form a 5 -tuple will be a multiple of 5, since it is of the form v ! w ! x ! y ! z ! 5 ! where 0 ≤ v , w , x , y , z ≤ 4 and v + w + x + y + z = 5 . If there are h non-zero entries, then for each permutation of the numbers, there will be 2 h ways of making a 5 -tuple from that permutation by choosing a sign for each non-zero entry. Since h > 0 , the number of these will be a multiple of 10.
If the a i values are all the same, then there are 32 different 5 -tuples that have the same multi-set of elements. We will only ever have all the a i values being the same when n = 5 a 1 2 , or, that is to say when n is 5 times a perfect square.
The number of numbers less than 5 6 7 8 that have this property is ⌊ 5 k ⌋ , hence the sum of D i is 2 × ⌊ 5 k ⌋ = 6 6 .
Problem Loading...
Note Loading...
Set Loading...
Say two solutions to the equation, for some given n, are associated if one can be obtained from the other by some sign changes and a permutation of the terms. Clearly solutions being associated is an equivalence relation. It is clear we can vary the signs and positions of the numbers independently (e.g. by suffixing letters A, B, C, D and E to the numbers of some canonical solution).
We will show that most equivalence classes have size 0 mod 10. Since each class has nonzero terms, then choosing the signs will have an even number of choices, so it will be 0 mod 2.
Suppose not all of the a i in a solution are the same (in absolute value). So there is some number which occurs as exactly 1, 2, 3 or 4 of the a i . There are 5, 10, 10 or 5 (respectively) ways of choosing the slot the numbers of that absolute value fills, which is divisible by 5.
Hence, in this case the equivalence class is 0 mod 10, and we can ignore it.
Otherwise, the a i are the same, leaving 32 = 2 mod 10 possibilities for the sign.
If this happens, then n = 5 a 2 , so a can take any value at most 5 5 6 7 5 , which means that 1 ≤ a ≤ 3 3 . All these values work, so there are 2*33 = 66 solutions.