cp's OEIS Frontend

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.

A354432 a(n) is the numerator of the sum of the reciprocals of the nonprime divisors of n.

This page as a plain text file.
%I A354432 #27 Dec 07 2024 07:24:38
%S A354432 1,1,1,5,1,7,1,11,10,11,1,3,1,15,16,23,1,4,1,7,22,23,1,5,26,27,31,19,
%T A354432 1,41,1,47,34,35,36,61,1,39,40,31,1,55,1,29,6,47,1,7,50,29,52,17,1,25,
%U A354432 56,3,58,59,1,53,1,63,74,95,66,83,1,22,70,17,1,15,1,75,28
%N A354432 a(n) is the numerator of the sum of the reciprocals of the nonprime divisors of n.
%H A354432 Antti Karttunen, <a href="/A354432/b354432.txt">Table of n, a(n) for n = 1..20000</a>
%F A354432 a(p) = 1 for prime p. - _Michael S. Branicky_, May 28 2022
%e A354432 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, ...
%t A354432 Table[DivisorSum[n, 1/# &, !PrimeQ[#] &], {n, 75}] // Numerator
%o A354432 (PARI) a(n) = numerator(sumdiv(n, d, if(!isprime(d), 1/d))) \\ _Michael S. Branicky_, May 28 2022
%o A354432 (Python)
%o A354432 from fractions import Fraction
%o A354432 from sympy import divisors, isprime
%o A354432 def a(n): return sum(Fraction(1, d) for d in divisors(n, generator=True) if not isprime(d)).numerator
%o A354432 print([a(n) for n in range(1, 76)]) # _Michael S. Branicky_, May 28 2022
%o A354432 (Python)
%o A354432 from math import prod
%o A354432 from fractions import Fraction
%o A354432 from sympy import factorint
%o A354432 def A354432(n):
%o A354432     f = factorint(n)
%o A354432     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)).numerator # _Chai Wah Wu_, May 28 2022
%Y A354432 Cf. A017665, A018252, A023890, A028235, A354433 (denominators).
%K A354432 nonn,frac
%O A354432 1,4
%A A354432 _Ilya Gutkovskiy_, May 28 2022