A252668 Let k be the smallest number such that s(k) = odd part of digital sum of 5^k is a multiple of prime(n); then a(n)=k, if s(k) = prime(n). Otherwise, or if there is no such k, a(n)=0.
1, 2, 5, 4, 14, 6, 7, 16, 21, 23, 24, 0, 0, 32, 19, 20, 22, 186, 177, 26, 29, 27, 61, 236, 34, 0, 36, 78, 54, 0, 41, 87, 43, 44, 188, 0, 55, 118, 229, 66, 59, 70, 69, 60, 58, 0, 279, 147, 81, 610, 74, 325, 85, 101, 75, 179, 0, 369, 100, 97, 0, 91, 193, 95, 205
Offset: 3
Examples
If n=4, evidently, k=2, since 5^2=25, s(2)= 2+5 = 7 = prime(4). So a(4)=2. If n=14, then k=57, but s(57)>prime(14)=43, so a(14)=0 (the equation s(x)=43 has the smallest solution x=107).
Programs
-
PARI
s(k) = my(sd = sumdigits(5^k)); sd/2^valuation(sd, 2); a(n) = {p = prime(n); k = 1; while ((sk=s(k)) % p, k++); if (sk == p, k, 0);} \\ Michel Marcus, Dec 29 2014
Extensions
More terms from Peter J. C. Moses, Dec 20 2014
Comments