login
A329277
a(n) is the fixed point reached by iterating Euler's gradus function A275314 starting at n.
0
1, 2, 3, 3, 5, 3, 7, 3, 5, 3, 11, 5, 13, 3, 7, 5, 17, 3, 19, 7, 5, 5, 23, 3, 5, 3, 7, 5, 29, 3, 31, 3, 13, 3, 11, 7, 37, 7, 7, 3, 41, 3, 43, 13, 5, 3, 47, 7, 13, 3, 19, 7, 53, 3, 7, 3, 5, 3, 59, 5, 61, 3, 11, 7, 17, 3, 67, 19, 5, 5, 71, 3, 73, 7, 11, 5, 17, 5, 79
OFFSET
1,2
MATHEMATICA
gradus[n_] := 1 + Plus @@ ((First[#] - 1) * Last[#] & /@ FactorInteger[n]); a[n_] := FixedPoint[gradus, n]; Array[a, 100] (* Amiram Eldar, Nov 11 2019 *)
PROG
(Python)
from gmpy2 import is_prime
from sympy import factorint
def gradus(n):
sum = 0
factors = factorint(n)
for p, a in factors.items():
sum += (p - 1)*a
return sum + 1
if __name__ == "__main__":
glist = []
for x in range(1, 80):
glist.append(gradus(x))
while True:
for p in glist:
a = 0
if not is_prime(p):
glist = [gradus(x) for x in glist]
a = 1
if a == 0:
break
print(', '.join([str(x) for x in glist]))
(PARI) g(n) = my (f=factor(n)); 1+sum(k=1, #f~, f[k, 2]*(f[k, 1]-1))
a(n) = while (n!=n=g(n), ); n \\ Rémy Sigrist, Dec 03 2019
CROSSREFS
Sequence in context: A214127 A111607 A327124 * A117531 A275940 A105555
KEYWORD
nonn
AUTHOR
Daniel Hoyt, Nov 11 2019
STATUS
approved