A174863 Little omega analog to Liouville's function L(n).
1, 0, -1, -2, -3, -2, -3, -4, -5, -4, -5, -4, -5, -4, -3, -4, -5, -4, -5, -4, -3, -2, -3, -2, -3, -2, -3, -2, -3, -4, -5, -6, -5, -4, -3, -2, -3, -2, -1, 0, -1, -2, -3, -2, -1, 0, -1, 0, -1, 0, 1, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 4, 3, 4, 3, 4, 5, 6, 7
Offset: 1
Keywords
Examples
a(4) = -2 because: a(1) = 1, as 1 has an even number of prime factors; then 2 and 3 being prime, bring the running sum down to -1; and then 4, which has one distinct prime factor, brings the sum down to -2. (This is the first term that differs from the Mertens function and Liouville's function.)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Michael J. Mossinghoff and Timothy S. Trudgian, A tale of two omegas, arXiv:1906.02847 [math.NT], 2019.
- Wolfgang Schwarz, A remark on multiplicative functions, Bulletin of the London Mathematical Society, Vol. 4, No. 2 (1972), pp. 136-140; alternative link.
- Jan van de Lune and Robert E. Dressler, Some theorems concerning the number theoretic function omega(n), Journal für die reine und angewandte Mathematik, Vol. 277 (1975), pp. 117-119; alternative link.
Crossrefs
Programs
-
Haskell
a174863 n = a174863_list !! (n-1) a174863_list = scanl1 (+) a076479_list -- Reinhard Zumkeller, Jun 01 2013
-
Mathematica
s=0; Table[s=s+(-1)^PrimeNu[n]; s, {n, 100}] (* PrimeNu is new in Mathematica 7.0 *)
-
PARI
a(n)=sum(k=1,n,(-1)^omega(k)) \\ Charles R Greathouse IV, Mar 27 2012
-
PARI
a(n)=my(v=vectorsmall(n, i, 1)); forprime(p=2, n, forstep(i=p, n, p, v[i]*=-1)); sum(i=1, #v, v[i]) \\ Charles R Greathouse IV, Aug 21 2016
-
Python
from sympy import primefactors def omega(n): return 0 if n==1 else len(primefactors(n)) def a(n): return sum([(-1)**omega(i) for i in range(1, n + 1)]) # Indranil Ghosh, May 20 2017
Formula
a(n) = Sum_{i = 1..n} (-1)^omega(i).
A275547(a(n)) = 0. - Alois P. Heinz, Aug 03 2016
From Ridouane Oudra, Dec 31 2020: (Start)
a(n) = Sum_{i=1..n} Sum_{j=1..n} mu(i*j)*floor(n/(i*j));
a(n) = Sum_{i=1..n} mu(i)*tau(i)*floor(n/i);
a(n) = Sum_{i=1..n} 2^Omega(i)*mu(i)*floor(n/i), where Omega = A001222. (End)
From Amiram Eldar, Mar 05 2021: (Start)
a(n) ~ O(n * exp(-c*sqrt(log(n)))) (Schwarz, 1972).
a(n) ~ o(n) (van de Lune and Dressler, 1975). (End)
a(n) = 1 + Sum_{k>=1} (-1)^k * A346617(n,k). - Alois P. Heinz, Aug 19 2021
Comments