This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A366144 #30 Oct 02 2023 15:25:47 %S A366144 1,1,6,12,10,24,14,2,3,40,22,2,26,56,60,80,34,3,38,120,84,88,46,3,75, %T A366144 104,108,168,58,240,62,192,132,136,140,4,74,152,156,5,82,336,86,264, %U A366144 270,184,94,480,147,300,204,312,106,432,220,7,228,232,118,5,122,248,378,448,260,528,134 %N A366144 a(n) = n/d(n) if d(n) | n, otherwise a(n) = n*d(n), where d(n) = A000005(n) is the number of divisors of n. %H A366144 Michael De Vlieger, <a href="/A366144/b366144.txt">Table of n, a(n) for n = 1..10000</a> %H A366144 Michael De Vlieger, <a href="/A366144/a366144_1.png">Log log scatterplot of a(n)</a>, n = 1..2^14, showing primes in red, composite prime powers in gold, even squarefree semiprimes in light green, other squarefree composites in dark green, and numbers neither squarefree nor prime powers in blue. Powerful numbers that are not prime powers are highlighted in light blue. %H A366144 Neal Gersh Tolunsky, <a href="/A366144/a366144.png">Graph of first 150000 terms</a>. %F A366144 sqrt(n)/2 <= a(n) <= 2*n*sqrt(n). - _Yifan Xie_, Oct 01 2023 %e A366144 n=3 has d(3) = 2 divisors (like all primes) and 3 is not divisible by 2, so we multiply: a(3) = 3*2 = 6. %e A366144 n=8 has d(8) = 4 divisors and 8 is divisible by 4, so we divide: a(8) = 8/4 = 2. %t A366144 a[n_] := n * If[Divisible[n, d = DivisorSigma[0, n]], 1/d, d]; Array[a, 100] (* _Amiram Eldar_, Oct 01 2023 *) %o A366144 (PARI) a(n) = my(d=numdiv(n)); if (n % d, n*d, n/d); \\ _Michel Marcus_, Oct 01 2023 %o A366144 (Python) %o A366144 from sympy import divisor_count %o A366144 def A366144(n): return n*d if (q:=divmod(n,d:=int(divisor_count(n))))[1] else q[0] # _Chai Wah Wu_, Oct 02 2023 %Y A366144 Cf. A000005, A038040, A033950, A036762. %Y A366144 Cf. A366067 (iterate starting 578). %K A366144 nonn,easy %O A366144 1,3 %A A366144 _Neal Gersh Tolunsky_, Sep 30 2023