OFFSET
1,1
COMMENTS
578 is the smallest starting number for this rule which seems to diverge (rather than entering a loop). This starting number was found by Robert Gerbicz, who made the following argument for the sequence's divergence:
When the exponent of 2 is t in the prime factorization of n, then t+1 divides tau(n), and if t+1 has a relatively large prime factor r, then it is likely that n is not divisible by r and so n will be multiplied by tau(n). So r is now a factor of n, which means it will be even harder to clear r from n. In the range of 2000 iterations, division occurs only a few times. In almost all cases, you need only check the exponent of 2 to see if it was a division or multiplication.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..960
Neal Gersh Tolunsky, Log plot of a(1..1000).
EXAMPLE
a(1) = 578. Applying the rule in A366144, 578 has 6 divisors. 578 is not divisible by 6, so we multiply: a(2) = 578*6 = 3468.
a(7) = 177698535505920, which has 3888 divisors. 177698535505920 is divisible by 3888, so we divide: a(8) = 177698535505920/3888 = 45704355840.
MATHEMATICA
a[1] = 578; a[n_] := a[n] = a[n-1] * If[Divisible[a[n-1], d = DivisorSigma[0, a[n-1]]], 1/d, d]; Array[a, 18] (* Amiram Eldar, Sep 29 2023 *)
PROG
(Python)
from itertools import islice
from sympy import divisor_count
def f(n): return n//dn if n%(dn:=divisor_count(n)) == 0 else n*dn
def agen(x=578): # generator of terms
while True: yield x; x = f(x)
print(list(islice(agen(), 18))) # Michael S. Branicky, Oct 03 2023
(Python)
from math import prod
from collections import Counter
from itertools import islice
from sympy import factorint
def A366067_gen(): # generator of terms
a, b = 578, Counter({2:1, 17:2})
while True:
yield a
c = prod((e+1 for e in b.values()))
if (d:=sum((Counter(factorint(e+1)) for e in b.values()), start=Counter()))<=b:
a //= c
b -=d
else:
a *= c
b += d
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Sep 28 2023
STATUS
approved