A252666 Let k be the smallest number such that s(k) = odd part of digital sum of 2^k is multiple of prime(n); then a(n)=k, if s(k) = prime(n). Otherwise, or if there is no such k, a(n)=0.
5, 4, 7, 8, 47, 12, 42, 19, 20, 24, 23, 28, 31, 76, 35, 34, 38, 39, 48, 52, 116, 63, 0, 140, 68, 81, 66, 89, 96, 198, 97, 92, 415, 94, 0, 229, 119, 121, 539, 132, 133, 146, 292, 162, 158, 148, 651, 164, 153, 167, 196, 165, 757, 205, 201, 0, 184, 175
Offset: 3
Examples
If n=3, evidently, k=5, since 2^5=32, s(5)= 3+2 = 5 = prime(3). So a(3)=5. If n=25, then k=387, but s(387)>prime(25)=97, so a(25)=0 (the equation s(x)=97 has the smallest solution x=517).
Programs
-
PARI
s(k) = my(sd = sumdigits(2^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