A358633 a(n) is the smallest k > 1 such that the sum of digits of n^k is a power of n (or -1 if no such k exists).
2, 2, 2, 18, 8, 7, 4, 3, 2, 2, 45741764, 4216, 32, 537, 39, 44, 3, 3, 1187, 13, 67, 4
Offset: 1
Examples
The sum of digits of 1^2 = 1 is 1, which is a power of 1, so a(1) = 2. The sum of digits of 2^2 = 4 is 4, which is a power of 2, so a(2) = 2. For k = 2..17, the sum of digits of 4^k is {7, 10, 13, 7, 19, 22, 25, 19, 31, 25, 37, 40, 43, 37, 58, 61}, none of which is a power of 4, but the sum of digits of 4^18 = 68719476736 is 6+8+7+1+9+4+7+6+7+3+6 = 64 = 4^3, so a(4) = 18.
Programs
-
PARI
isok(k,n) = my(s=sumdigits(n^k), x, y); if (s==1, return(2)); (s==n) || ((ispower(s,,&x)) && ((x==n) || (ispower(n,,&y) && (y==x)))); a(n) = my(k=2); while (!isok(k,n), k++); k; \\ Michel Marcus, Nov 25 2022
Extensions
a(11)-a(22) from Martin Ehrenstein, Nov 26 2022
Comments