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 A103340 #28 Mar 18 2023 16:29:36 %S A103340 1,3,2,5,3,1,4,9,5,9,6,5,7,3,2,17,9,5,10,3,8,9,12,3,13,21,14,5,15,3, %T A103340 16,33,4,27,12,25,19,15,14,27,21,2,22,15,1,9,24,17,25,39,6,35,27,7,18, %U A103340 9,20,45,30,1,31,12,20,65,21,3,34,45,8,9,36,5,37,57,26,25,24,7,40,51,41,63 %N A103340 Denominator of the unitary harmonic mean (i.e., the harmonic mean of the unitary divisors) of the positive integer n. %H A103340 Reinhard Zumkeller, <a href="/A103340/b103340.txt">Table of n, a(n) for n = 1..10000</a> %F A103340 a(A006086(n)) = 1. - _Reinhard Zumkeller_, Mar 17 2012 %e A103340 1, 4/3, 3/2, 8/5, 5/3, 2, ... %e A103340 a(8) = 9 because the unitary divisors of 8 are {1,8} and 2/(1/1 + 1/8) = 16/9. %p A103340 with(numtheory): udivisors:=proc(n) local A, k: A:={}: for k from 1 to tau(n) do if gcd(divisors(n)[k], n/divisors(n)[k])=1 then A:=A union {divisors(n)[k]} else A:=A fi od end: utau:=n->nops(udivisors(n)): usigma:=n->sum(udivisors(n)[j],j=1..nops(udivisors(n))): uH:=n->n*utau(n)/usigma(n):seq(denom(uH(n)),n=1..90); %t A103340 ud[n_] := 2^PrimeNu[n]; usigma[n_] := DivisorSum[n, If[GCD[#, n/#] == 1, #, 0]&]; a[1] = 1; a[n_] := Denominator[n*ud[n]/usigma[n]]; Array[a, 100] (* _Jean-François Alcover_, Dec 03 2016 *) %t A103340 a[n_] := Denominator[n * Times @@ (2 / (1 + Power @@@ FactorInteger[n]))]; a[1] = 1; Array[a, 100] (* _Amiram Eldar_, Mar 10 2023 *) %o A103340 (Haskell) %o A103340 import Data.Ratio ((%), denominator) %o A103340 a103340 = denominator . uhm where uhm n = (n * a034444 n) % (a034448 n) %o A103340 -- _Reinhard Zumkeller_, Mar 17 2012 %o A103340 (Python) %o A103340 from sympy import gcd %o A103340 from sympy.ntheory.factor_ import udivisor_sigma %o A103340 def A103340(n): return (lambda x, y: x//gcd(x,y*n))(udivisor_sigma(n),udivisor_sigma(n,0)) # _Chai Wah Wu_, Oct 20 2021 %o A103340 (PARI) %o A103340 a(n) = {my(f = factor(n)); denominator(n * prod(i=1, #f~, 2/(1 + f[i, 1]^f[i, 2]))); } \\ _Amiram Eldar_, Mar 10 2023 %Y A103340 Cf. A103339 (numerators), A099377, A099378. %Y A103340 Cf. A034444, A034448, A077610. %K A103340 frac,nonn %O A103340 1,2 %A A103340 _Emeric Deutsch_, Jan 31 2005