A373917 Triangle read by rows: T(n,k) = k*10 mod n, with n >= 1, k >= 0.
0, 0, 0, 0, 1, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 4, 2, 0, 4, 2, 0, 3, 6, 2, 5, 1, 4, 0, 2, 4, 6, 0, 2, 4, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 8, 6, 4, 2, 0, 10, 8, 6, 4, 2, 0, 10, 7, 4, 1, 11, 8, 5, 2, 12, 9, 6, 3
Offset: 1
Examples
Triangle begins: n\k| 0 1 2 3 4 5 6 7 8 9 --------------------------------- 1 | 0; 2 | 0, 0; 3 | 0, 1, 2; 4 | 0, 2, 0, 2; 5 | 0, 0, 0, 0, 0; 6 | 0, 4, 2, 0, 4, 2; 7 | 0, 3, 6, 2, 5, 1, 4; 8 | 0, 2, 4, 6, 0, 2, 4, 6; 9 | 0, 1, 2, 3, 4, 5, 6, 7, 8; 10 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0; ... Suppose m = 3714289 and you want to determine m mod 7 (the example shown in the video). Start with the first digit of m (3) and calculate T(7,3 mod 7) = T(7,3) = 2. Add it to the next digit of m (7) and calculate T(7,(2+7) mod 7) = T(7,2) = 6. Add it to the next digit of m (1) and calculate T(7,(6+1) mod 7) = T(7,0) = 0. Add it to the next digit of m (4) and calculate T(7,(0+4) mod 7) = T(7,4) = 5. Add it to the next digit of m (2) and calculate T(7,(5+2) mod 7) = T(7,0) = 0. Add it to the next digit of m (8) and calculate T(7,(0+8) mod 7) = T(7,1) = 3. Add it to the final digit of m (9) and calculate (3+9) mod 7 = 5, which corresponds to 3714289 mod 7.
Links
- John Tyler Rascoe, Rows n = 1..150, flattened
- James Grime and Brady Haran, Solving Seven, Numberphile YouTube video, 2024.
Programs
-
Mathematica
Table[Mod[Range[0, 10*(n-1), 10], n], {n, 15}]
-
Python
def A373917(n,k): return(k*10%n) # John Tyler Rascoe, Jul 02 2024
Comments