+0

# help

0
449
1
+1196

The first digit of a string of 2002 digits is a 1. Any two-digit number formed by consecutive digits within this string is divisible by 19 or 31. What is the largest possible last digit in this string?

Oct 12, 2018

#1
+6115
+1

2 digit multiples of 19 are (19, 38, 57, 76, 95)

2 digit multiples of 31 are (31, 62, 93)

1 -> 19

19 -> 193 or 195

193 -> 1931 or 1938

195 -> 1957

1931 -> 19319

1938 -> X

1957 -> 19576

19319 -> 193193 or 193195

19576 -> 195762

193193 -> 1931931 or 1931938

193195 -> 1931957

195762 -> X

1931931 -> 19319319

1931938 -> X

1931957 -> 19319576

continuing this way for a bit we see the following pattern

strings of (4+3k) digits will have the last digit in the set (1,7,8)

strings of (5+3k) digits will have the last digit in the set (6, 9)

strings of (6+3k) digits will have the last digit in the set (2, 3, 5)

2002 = 4 + 3(666)

so the possible last digits in the string will be 1, 7, or 8

8 is the largest of these

Oct 12, 2018