MathCastle
Number TheoryHardDivisibility

Divisibility · Hard problem

Since 1001=7⋅11⋅131001 = 7\cdot11\cdot13 and 1000=1001−11000 = 1001 - 1, a number leaves the same remainder mod 1313 as the alternating sum of its three-digit blocks taken from the right. Use this to find the remainder when 123,456,789123{,}456{,}789 is divided by 1313.