OFFSET
1,3
COMMENTS
Equivalently, the number of positive integers less than or equal to n with the same number of prime factors as n, counted with multiplicity. - Gus Wiseman, Dec 28 2018
There is a close relationship between a(n) and a(n^2). See A209934 for an exploratory quantification. - Peter Munn, Aug 04 2019
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
FORMULA
Ordinal transform of A001222 (bigomega). - Franklin T. Adams-Watters, Aug 28 2006
If a(n) < a(3^A001222(2n)) = A078843(A001222(2n)) then a(2n) = a(n), otherwise a(2n) > a(n). - Peter Munn, Aug 05 2019
EXAMPLE
3 is prime, so a(3)=2. 10 is 2-almost prime (semiprime), so a(10)=4.
From Gus Wiseman, Dec 28 2018: (Start)
Column n lists the a(n) positive integers less than or equal to n with the same number of prime factors as n, counted with multiplicity:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
---------------------------------------------------------------------
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 3 4 5 6 9 7 8 11 10 14 13 12 17 18
2 3 4 6 5 7 9 10 11 8 13 12
2 4 3 5 6 9 7 11 8
2 3 4 6 5 7
2 4 3 5
2 3
2
(End)
MAPLE
p:= proc() 0 end:
a:= proc(n) option remember; local t;
t:= numtheory[bigomega](n);
p(t):= p(t)+1
end:
seq(a(n), n=1..100); # Alois P. Heinz, Oct 09 2015
MATHEMATICA
p[_] = 0; a[n_] := a[n] = Module[{t}, t = PrimeOmega[n]; p[t] = p[t]+1]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 24 2017, after Alois P. Heinz *)
PROG
(PARI) a(n) = my(k=bigomega(n)); sum(i=1, n, bigomega(i)==k); \\ Michel Marcus, Jun 27 2024
(Python)
from math import prod, isqrt
from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
def A058933(n):
if n==1: return 1
if isprime(n): return primepi(n)
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)))) # Chai Wah Wu, Aug 28 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Naohiro Nomoto, Jan 11 2001
EXTENSIONS
Name edited by Peter Munn, Dec 30 2022
STATUS
approved