OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(p) = 1 for prime p. - Michael S. Branicky, May 28 2022
EXAMPLE
1, 1, 1, 5/4, 1, 7/6, 1, 11/8, 10/9, 11/10, 1, 3/2, 1, 15/14, 16/15, 23/16, ...
MATHEMATICA
Table[DivisorSum[n, 1/# &, !PrimeQ[#] &], {n, 75}] // Denominator
PROG
(PARI) a(n) = denominator(sumdiv(n, d, if(!isprime(d), 1/d))) \\ Michael S. Branicky, May 28 2022
(Python)
from fractions import Fraction
from sympy import divisors, isprime
def a(n): return sum(Fraction(1, d) for d in divisors(n, generator=True) if not isprime(d)).denominator
print([a(n) for n in range(1, 76)]) # Michael S. Branicky, May 28 2022
(Python)
from math import prod
from fractions import Fraction
from sympy import factorint
def A354433(n):
f = factorint(n)
return (Fraction(prod(p**(e+1)-1 for p, e in f.items()), prod(p-1 for p in f)*n) - sum(Fraction(1, p) for p in f)).denominator # Chai Wah Wu, May 28 2022
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Ilya Gutkovskiy, May 28 2022
STATUS
approved