A very long number

From the 2000 University of Waterloo Cayley Contest:

The leftmost digit of an integer of length 2000 digits is 3. In this integer, any two consecutive digits must be divisible by 17 or 23. The 2000th digit may be either ‘a’ or ‘b’. What is the value of a+b?



A Strange Die

A PuzzleCritic Original:

A cube has a different positive integer painted on every face, so that every pair of numbers on adjacent faces has a sum divisible by 7. Let T be the sum of all the numbers that appear. Find, with proof, the smallest possible value of T.