|
|
A345748
|
|
a(n) is the number of distinct terms in the trajectory of n under the map k -> A001222(k)*A001414(k).
|
|
0
|
|
|
2, 1, 1, 10, 1, 11, 1, 9, 5, 10, 1, 4, 1, 9, 10, 9, 1, 8, 1, 2, 3, 3, 1, 7, 3, 2, 1, 2, 1, 1, 1, 8, 2, 9, 8, 6, 1, 8, 9, 5, 1, 7, 1, 4, 3, 8, 1, 10, 3, 7, 6, 7, 1, 5, 9, 8, 5, 13, 1, 11, 1, 12, 10, 13, 7, 11, 1, 11, 8, 8, 1, 12, 1, 7, 10, 9, 7, 6, 1, 8, 11, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(n) is the length of a list derived by recursively taking the sum of prime factors of n multiplied by the number of prime factors of n, appending each term to the list without duplicates until a fixed point is reached.
|
|
LINKS
|
|
|
EXAMPLE
|
Starting with n = 8, we add it to the list: [8]. There are three prime factors of 8, [2,2,2]. These sum to 6. 6 * 3 = 18. We add 18 to the list: [8, 18]. We then repeat the process with 18 to get [8, 18, 24]. The list grows as follows: [8, 18, 24, 36, 40, 44, 45, 33, 28]. Since 28 results in a number we've already seen, we halt. The number of elements in the list is 9, so a(8) = 9.
|
|
MATHEMATICA
|
f[n_] := PrimeOmega[n] * (Plus @@ Times @@@ FactorInteger[n]); a[n_] := -1 + Length @ NestWhileList[f, n, UnsameQ, All]; Array[a, 100] (* Amiram Eldar, Jun 27 2021 *)
|
|
PROG
|
(Haskell)
term :: Integer -> Integer
term n = genericLength $ term' [n]
where
term' [] = []
term' ns@(n':_)
| h `elem` ns = ns
| otherwise = term' (h:ns)
where
h = let pfs = primeFactors n' in sum pfs * genericLength pfs
(Python)
from sympy import factorint
def t(n): f = factorint(n); return sum(f.values())*sum(p*f[p] for p in f)
def a(n):
iter, seen = n, set()
while iter not in seen: iter, seen = t(iter), seen|{iter}
return len(seen)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|