OFFSET
1,2
COMMENTS
EXAMPLE
For n = 24, a(24) = gcd(24, 2*2 + 4*4) = gcd(24,20) = 4, thus a(24) = 4;
for n = 153, a(153) = gcd(153, 1*1*1 + 5*5*5 + 3*3*3) = gcd(153,153) = 153, thus a(153) = 153.
MATHEMATICA
Array[GCD[#1, Total[#2^Length[#2]]] & @@ {#, IntegerDigits@ #} &, 90] (* Michael De Vlieger, Feb 09 2019 *)
PROG
(PARI) a(n) = my(d=digits(n)); gcd(n, sum(i=1, #d, d[i]^#d)); \\ Michel Marcus, Feb 12 2019
(Python)
from math import gcd
def A306354(n): return gcd(n, sum(int(d)**len(str(n)) for d in str(n))) # Chai Wah Wu, Jan 26 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Feb 09 2019
STATUS
approved