A178065 Number of 1's in binary representation of n-th semiprime.
1, 2, 2, 2, 3, 4, 3, 3, 3, 3, 2, 2, 3, 3, 4, 4, 3, 4, 5, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 5, 5, 5, 6, 4, 6, 5, 5, 6, 5, 5, 6, 2, 3, 3, 4, 4, 5, 3, 3, 5, 5, 6, 3, 4, 4, 4, 4, 6, 5, 6, 3, 4, 4, 5, 5, 5, 4, 5, 5, 6, 5, 5, 6, 6, 4, 6, 6, 7, 6, 7, 7, 3, 3, 3, 4, 3, 4, 6, 3, 4, 5, 4, 5, 5, 5, 6, 4, 5, 5, 7, 3, 4, 4, 5
Offset: 1
Examples
a(1)=1 because the first semiprime is 4 = 100_2. a(2)=2 because the second semiprime is 6 = 110_2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
N:= 10^3: # for semiprimes <= N P:= select(isprime,[2,seq(i,i=3..N/2,2)]): SP:= sort(select(`<=`,[seq(seq(P[i]*P[j],j=1..i),i=1..nops(P))],N)): map(t -> convert(convert(t,base,2),`+`), SP); # Robert Israel, Feb 02 2025
-
Mathematica
s={};Do[If[PrimeOmega[n]==2,AppendTo[s,Total[IntegerDigits[n,2]]]],{n,400}];s (* James C. McMahon, Jan 02 2025 *)
-
PARI
lista(nn) = {for (n=2, nn, if (bigomega(n)==2, print1(norml2(binary(n)), ", ")););} \\ Michel Marcus, Jun 05 2013
Extensions
a(56) corrected by R. J. Mathar, May 23 2010