OFFSET
1,5
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = |{j < n : bigomega(j) = bigomega(n)}|.
a(n) = A058933(n) - 1.
EXAMPLE
a(10) = 3 because bigomega(10) = 2 and also bigomega(4) = bigomega(6) = bigomega(9) = 2.
MAPLE
A:= NULL:
for n from 1 to 100 do
t:= numtheory:-bigomega(n);
if not assigned(R[t]) then
A:= A, 0;
R[t]:= 1;
else
A:= A, R[t];
R[t]:= R[t]+1;
fi
od:
A; # Robert Israel, Oct 24 2021
MATHEMATICA
Table[Length[Select[Range[n - 1], PrimeOmega[#] == PrimeOmega[n] &]], {n, 80}]
PROG
(PARI) a(n)={my(t=bigomega(n)); sum(k=1, n-1, bigomega(k)==t)} \\ Andrew Howroyd, Oct 31 2020
(Python)
from math import prod, isqrt
from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
def A335097(n):
if n==1: return 0
if isprime(n): return primepi(n)-1
def g(x, a, b, c, m): yield from (((d, ) for d in enumerate(primerange(b, isqrt(x//c)+1), a)) if m==2 else (((a2, b2), )+d for a2, b2 in enumerate(primerange(b, integer_nthroot(x//c, m)[0]+1), a) for d in g(x, a2, b2, c*b2, m-1)))
return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n, 0, 1, 1, primeomega(n)))-1) # Chai Wah Wu, Aug 28 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 31 2020
STATUS
approved