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.

A049060 a(n) = (-1)^omega(n)*Sum_{d|n} d*(-1)^omega(d), where omega(n) = A001221(n) is number of distinct primes dividing n.

This page as a plain text file.
%I A049060 #39 Jul 02 2025 16:01:57
%S A049060 1,1,2,5,4,2,6,13,11,4,10,10,12,6,8,29,16,11,18,20,12,10,22,26,29,12,
%T A049060 38,30,28,8,30,61,20,16,24,55,36,18,24,52,40,12,42,50,44,22,46,58,55,
%U A049060 29,32,60,52,38,40,78,36,28,58,40,60,30,66,125,48,20,66,80,44,24,70
%N A049060 a(n) = (-1)^omega(n)*Sum_{d|n} d*(-1)^omega(d), where omega(n) = A001221(n) is number of distinct primes dividing n.
%C A049060 Might be called (-1)sigma(n). If x = Product p_i^r_i, then (-1)sigma(x) = Product (-1 + Sum p_i^s_i, s_i = 1 to r_i) = Product ((p_i^(r_i+1)-1)/(p_i-1)-2), with (-1)sigma(1) = 1. - _Yasutoshi Kohmoto_, May 23 2005
%H A049060 R. J. Mathar, <a href="/A049060/b049060.txt">Table of n, a(n) for n = 1..100000</a>
%F A049060 a(n) = Sum_{d|n} d*(-1)^A001221(d).
%F A049060 Multiplicative with a(p^e) = (p^(e+1)-2*p+1)/(p-1).
%F A049060 Simpler: a(p^e) = (p^(e+1)-1)/(p-1)-2. - _M. F. Hasler_, Sep 21 2022
%F A049060 Sum_{k=1..n} a(k) ~ c * n^2, where c = (Pi^2/12) * Product_{p prime} (1 - 2/p^2 + 2/p^3) = 0.4478559359... . - _Amiram Eldar_, Oct 25 2022
%p A049060 A049060 := proc(n) local it, ans, i, j; it := ifactors(n): ans := 1: for i from 1 to nops(ifactors(n)[2]) do ans := ans*(-1+sum(ifactors(n)[2][i][1]^j, j=1..ifactors(n)[2][i][2])): od: RETURN(ans) end: [seq(A049060(i),i=1..n)];
%t A049060 a[p_?PrimeQ] := p-1; a[1] = 1; a[n_] := Times @@ ((#[[1]]^(#[[2]] + 1) - 2*#[[1]] + 1)/(#[[1]] - 1) & ) /@ FactorInteger[n]; Table[a[n], {n, 1, 71}] (* _Jean-François Alcover_, May 21 2012 *)
%o A049060 (PARI) A049060(n)={ local(i,resul,rmax,p) ; if(n==1, return(1) ) ; i=factor(n) ; rmax=matsize(i)[1] ; resul=1 ; for(r=1,rmax, p=0 ; for(j=1,i[r,2], p += i[r,1]^j ; ) ; resul *= p-1 ; ) ; return(resul) ; } { for(n=1,40, print(n," ",A049060(n)) ) ; } \\ _R. J. Mathar_, Oct 12 2006
%o A049060 (PARI) apply( A049060(n)=vecprod([(f[1]^(f[2]+1)-1)\(f[1]-1)-2 | f<-factor(n)~]), [1..99]) \\ _M. F. Hasler_, Sep 21 2022
%o A049060 (Python)
%o A049060 from math import prod
%o A049060 from sympy import factorint
%o A049060 def A049060(n): return prod((p**(e+1)-2*p+1)//(p-1) for p,e in factorint(n).items()) # _Chai Wah Wu_, Sep 13 2021
%Y A049060 Used in A049057, A049058, A049059.
%Y A049060 Cf. A000203, A001221, A057723, A060640, A126602, A126690.
%K A049060 easy,nonn,nice,mult
%O A049060 1,3
%A A049060 _N. J. A. Sloane_
%E A049060 More terms from _James Sellers_, May 03 2000
%E A049060 Better description from _Vladeta Jovovic_, Apr 06 2002