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.

A346622 a(n) = card{ x <= n : x odd and omega(x) = 2 }.

This page as a plain text file.
%I A346622 #14 Oct 05 2022 13:40:42
%S A346622 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,3,3,
%T A346622 4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,8,8,9,9,9,9,9,9,10,10,11,11,
%U A346622 11,11,12,12,12,12,12,12,13,13,14,14,14,14,14,14,14,14,15,15,16
%N A346622 a(n) = card{ x <= n : x odd and omega(x) = 2 }.
%H A346622 Chai Wah Wu, <a href="/A346622/b346622.txt">Table of n, a(n) for n = 1..10000</a>
%p A346622 a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+
%p A346622      `if`(n::odd and nops(ifactors(n)[2])=2, 1, 0))
%p A346622     end:
%p A346622 seq(a(n), n=1..87);  # _Alois P. Heinz_, Aug 23 2021
%t A346622 a[n_] := a[n] = If[n==0, 0, a[n-1]+If[OddQ[n] && PrimeNu[n]==2, 1, 0]];
%t A346622 Table[a[n], {n, 1, 87}] (* _Jean-François Alcover_, Apr 07 2022 *)
%t A346622 nxt[{n_,a_}]:={n+1,If[EvenQ[n]&&PrimeNu[n+1]==2,1,0]+a}; NestList[nxt,{1,0},90][[All,2]] (* _Harvey P. Dale_, Oct 05 2022 *)
%o A346622 (Python)
%o A346622 from sympy import primefactors
%o A346622 def A346622(n):
%o A346622     return 0 if n <= 2 else A346622(n-1) + (1 if n % 2 and len(primefactors(n)) == 2 else 0) # _Chai Wah Wu_, Aug 23 2021
%Y A346622 Cf. A007774, A082997, A146167, A346623.
%K A346622 nonn
%O A346622 1,21
%A A346622 _N. J. A. Sloane_, Aug 23 2021