A341767 Replace each digit d in the decimal representation of n with the digital root of n^d.
1, 4, 9, 4, 2, 9, 7, 1, 9, 11, 22, 39, 41, 54, 69, 71, 88, 99, 11, 41, 93, 77, 78, 99, 44, 11, 99, 11, 48, 91, 14, 87, 99, 17, 88, 99, 11, 84, 99, 41, 45, 99, 71, 11, 99, 11, 72, 99, 41, 21, 96, 44, 88, 99, 11, 51, 99, 77, 28, 91, 17, 11, 99, 11, 15, 99, 14
Offset: 1
Examples
a(26) = 11, since 26^2 = 676 and 26^6 = 308915776. 6 + 7 + 6 = 19, 1 + 9 = 10 and 1 + 0 = 1, so the digital root of 676 is 1. 3 + 0 + 8 + 9 + 1 + 5 + 7 + 7 + 6 = 46, 4 + 6 = 10 and 1 + 0 = 1, so the digital root of 308915776 is 1. Thus, for 26, both "2" and "6" will be replaced by "1".
Links
- Sebastian Karlsson, Table of n, a(n) for n = 1..10000
- Sebastian Karlsson, Generalized and plotted in arbitrary bases
Programs
-
Mathematica
a[n_] := FromDigits[Mod[n^IntegerDigits[n] - 1, 9] + 1]; Array[a, 100] (* Amiram Eldar, Feb 19 2021 *)
-
PARI
dr(n) = if(n, (n-1)%9+1); \\ A010888 a(n) = my(d=digits(n)); fromdigits(vector(#d, k, dr(n^d[k]))); \\ Michel Marcus, Feb 19 2021
-
Python
def a(n): return int(''.join(str((pow(n, int(d), 9)-1)%9 + 1) for d in str(n)))
Formula
a(10*n) = 10*a(n) + 1.
Comments