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.

A335097 Number of integers less than n with the same number of prime factors (counted with multiplicity) as n.

This page as a plain text file.
%I A335097 #42 Aug 29 2024 01:35:47
%S A335097 0,0,1,0,2,1,3,0,2,3,4,1,5,4,5,0,6,2,7,3,6,7,8,1,8,9,4,5,9,6,10,0,10,
%T A335097 11,12,2,11,13,14,3,12,7,13,8,9,15,14,1,16,10,17,11,15,4,18,5,19,20,
%U A335097 16,6,17,21,12,0,22,13,18,14,23,15,19,2,20,24,16,17,25,18,21,3
%N A335097 Number of integers less than n with the same number of prime factors (counted with multiplicity) as n.
%H A335097 Robert Israel, <a href="/A335097/b335097.txt">Table of n, a(n) for n = 1..10000</a>
%F A335097 a(n) = |{j < n : bigomega(j) = bigomega(n)}|.
%F A335097 a(n) = A058933(n) - 1.
%e A335097 a(10) = 3 because bigomega(10) = 2 and also bigomega(4) = bigomega(6) = bigomega(9) = 2.
%p A335097 A:= NULL:
%p A335097 for n from 1 to 100 do
%p A335097   t:= numtheory:-bigomega(n);
%p A335097   if not assigned(R[t]) then
%p A335097     A:= A,0;
%p A335097     R[t]:= 1;
%p A335097    else
%p A335097     A:= A, R[t];
%p A335097     R[t]:= R[t]+1;
%p A335097    fi
%p A335097 od:
%p A335097 A; # _Robert Israel_, Oct 24 2021
%t A335097 Table[Length[Select[Range[n - 1], PrimeOmega[#] == PrimeOmega[n] &]], {n, 80}]
%o A335097 (PARI) a(n)={my(t=bigomega(n)); sum(k=1, n-1, bigomega(k)==t)} \\ _Andrew Howroyd_, Oct 31 2020
%o A335097 (Python)
%o A335097 from math import prod, isqrt
%o A335097 from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
%o A335097 def A335097(n):
%o A335097     if n==1: return 0
%o A335097     if isprime(n): return primepi(n)-1
%o A335097     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)))
%o A335097     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
%Y A335097 Cf. A000079 (positions of 0's), A001222, A047983, A058933, A067004, A322838, A334655.
%K A335097 nonn
%O A335097 1,5
%A A335097 _Ilya Gutkovskiy_, Oct 31 2020