login
A252280
For a prime p, denote by s(p,k) the odd part of the digital sum of p^k. Let k_1 be the smallest k such that s(p,k) is divisible by 7. Sequence lists primes p for which s(p,k_1)=7.
9
2, 5, 7, 11, 19, 29, 31, 37, 41, 43, 59, 61, 71, 73, 79, 97, 101, 103, 107, 109, 127, 137, 149, 151, 163, 167, 181, 193, 197, 211, 223, 233, 239, 241, 257, 271, 277, 293, 307, 313, 331, 347, 359, 373, 383, 397, 409, 419, 421, 431, 433, 467, 487, 491, 509, 523
OFFSET
1,1
COMMENTS
For s(p,k_1)=5, see A251964.
MATHEMATICA
s[p_, k_] := Module[{s = Total[IntegerDigits[p^k]]}, s/2^IntegerExponent[s, 2]]; f7[p_] := Module[{k = 1}, While[! Divisible[s[p, k], 7], k++]; k]; ok7Q[p_] := s[p, f7[p]] == 7; Select[Range[1000], PrimeQ[#] && ok7Q[#] &] (* Amiram Eldar, Dec 07 2018*)
PROG
(PARI) s(p, k) = my(s=sumdigits(p^k)); s >> valuation(s, 2);
f7(p) = my(k=1); while(s(p, k) % 7, k++); k;
isok7(p) = s(p, f7(p)) == 7;
lista7(nn) = forprime(p=2, nn, if (isok7(p), print1(p, ", "))); \\ Michel Marcus, Dec 07 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved