2042⋅1914
First we show the following lemma.
Lemma. Let a,b,c be integers satisfying a=0(mod17), b≥1, c≥4. Then abc≡1(mod17) holds if and only if a≡1(mod17) or b is even.
Proof. If a≡1(mod17), obviously abc≡1(mod17) holds. If b is even, c≥4 shows bc is divisible by 16. By Fermat's little theorem a16≡1(mod17) holds thus abc≡1(mod17). We show the converse. If abc≡1(mod17) holds, we can take minimum positive integer d satisfying ad≡1(mod17). If a=1(mod17) then d=1. Assume bc is not divisible by d, then bc can be written in the form bc=sd+t with a non-negative integer s and an integer t satisfying 1≤t<d hence
at≡(ad)s⋅at=abc≡1(mod17),
which contradicts to the minimality of d. Therefore bc is divisible by d. Similarly 16 is divisible by d and d=1 shows d is even. Hence bc is even and thus b is even. ■
If a1≡0(mod17) or a2≡0(mod17) then the condition is not satisfied. From here we assume a1=0(mod17) and a2=0(mod17). Let
c1=a3a4a5a6a7,c2=a4a5a6a7,
then c1≥22=4, c2≥22=4 holds. We have two cases; when a2 is odd and when it is even.
* When a2 is odd.
Lemma shows a1a2c1≡1(mod17) if and only if a1≡1(mod17). Since a2=18, we have a2=1(mod17) and then lemma shows a2a3c2≡1(mod17) if and only if a3 is even. Therefore the number of tuples satisfying the condition is 1⋅8⋅10⋅1914=80⋅1914.
* When a2 is even.
We have a1=0(mod17) then lemma shows a1a2c1≡1(mod17). By lemma, a2a3c2≡1(mod17) holds if and only if a2≡1(mod17) or a3 is even. Therefore the number of tuples satisfying the condition is 18⋅1⋅1915+18⋅9⋅10⋅1914=1962⋅1914.
Hence the total number of tuples satisfying the condition is 80⋅1914+1962⋅1914=2042⋅1914.