OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
1, 4/3, 3/2, 8/5, 5/3, 2, ...
a(8) = 16 because the unitary divisors of 8 are {1,8} and 2/(1/1 + 1/8) = 16/9.
MAPLE
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(numer(uH(n)), n=1..81);
MATHEMATICA
ud[n_] := 2^PrimeNu[n]; usigma[n_] := DivisorSum[n, If[GCD[#, n/#] == 1, #, 0]&]; a[1] = 1; a[n_] := Numerator[n*ud[n]/usigma[n]]; Array[a, 100] (* Jean-François Alcover, Dec 03 2016 *)
a[n_] := Numerator[n * Times @@ (2 / (1 + Power @@@ FactorInteger[n]))]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Mar 10 2023 *)
PROG
(Haskell)
import Data.Ratio ((%), numerator)
a103339 = numerator . uhm where uhm n = (n * a034444 n) % (a034448 n)
-- Reinhard Zumkeller, Mar 17 2012
(Python)
from sympy import gcd
from sympy.ntheory.factor_ import udivisor_sigma
def A103339(n): return (lambda x, y: y*n//gcd(x, y*n))(udivisor_sigma(n), udivisor_sigma(n, 0)) # Chai Wah Wu, Oct 20 2021
(PARI) a(n) = {my(f = factor(n)); numerator(n * prod(i=1, #f~, 2/(1 + f[i, 1]^f[i, 2]))); } \\ Amiram Eldar, Mar 10 2023
CROSSREFS
KEYWORD
frac,nonn
AUTHOR
Emeric Deutsch, Jan 31 2005
STATUS
approved