login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A103340 Denominator of the unitary harmonic mean (i.e., the harmonic mean of the unitary divisors) of the positive integer n. 10

%I #28 Mar 18 2023 16:29:36

%S 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 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 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 Denominator of the unitary harmonic mean (i.e., the harmonic mean of the unitary divisors) of the positive integer n.

%H Reinhard Zumkeller, <a href="/A103340/b103340.txt">Table of n, a(n) for n = 1..10000</a>

%F a(A006086(n)) = 1. - _Reinhard Zumkeller_, Mar 17 2012

%e 1, 4/3, 3/2, 8/5, 5/3, 2, ...

%e a(8) = 9 because the unitary divisors of 8 are {1,8} and 2/(1/1 + 1/8) = 16/9.

%p 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 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 a[n_] := Denominator[n * Times @@ (2 / (1 + Power @@@ FactorInteger[n]))]; a[1] = 1; Array[a, 100] (* _Amiram Eldar_, Mar 10 2023 *)

%o (Haskell)

%o import Data.Ratio ((%), denominator)

%o a103340 = denominator . uhm where uhm n = (n * a034444 n) % (a034448 n)

%o -- _Reinhard Zumkeller_, Mar 17 2012

%o (Python)

%o from sympy import gcd

%o from sympy.ntheory.factor_ import udivisor_sigma

%o 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 (PARI)

%o 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 Cf. A103339 (numerators), A099377, A099378.

%Y Cf. A034444, A034448, A077610.

%K frac,nonn

%O 1,2

%A _Emeric Deutsch_, Jan 31 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 08:08 EDT 2024. Contains 371265 sequences. (Running on oeis4.)