Denote by S the set of all primes p such that the decimal representation of p1 has the fundamental period of divisible by 3. For every p∈S such that p1 has the fundamental period 3r one may write p1=0.a1a2⋯a3ra1a2⋯a3r⋯, where r=r(p). For every p∈S and every integer k≥1 define f(k,p)=ak+ak+r(p)+ak+2r(p). [*] Prove that S is finite. [*] Find the highest value of f(k,p) for k≥1 and p∈S.