login
Numbers whose binary indices are all semiprimes.
3

%I #11 Aug 16 2024 20:48:24

%S 8,32,40,256,264,288,296,512,520,544,552,768,776,800,808,8192,8200,

%T 8224,8232,8448,8456,8480,8488,8704,8712,8736,8744,8960,8968,8992,

%U 9000,16384,16392,16416,16424,16640,16648,16672,16680,16896,16904,16928,16936,17152

%N Numbers whose binary indices are all semiprimes.

%C A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

%e The terms together with their binary expansions and binary indices begin:

%e 8: 1000 ~ {4}

%e 32: 100000 ~ {6}

%e 40: 101000 ~ {4,6}

%e 256: 100000000 ~ {9}

%e 264: 100001000 ~ {4,9}

%e 288: 100100000 ~ {6,9}

%e 296: 100101000 ~ {4,6,9}

%e 512: 1000000000 ~ {10}

%e 520: 1000001000 ~ {4,10}

%e 544: 1000100000 ~ {6,10}

%e 552: 1000101000 ~ {4,6,10}

%e 768: 1100000000 ~ {9,10}

%e 776: 1100001000 ~ {4,9,10}

%e 800: 1100100000 ~ {6,9,10}

%e 808: 1100101000 ~ {4,6,9,10}

%t bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];

%t semi[n_]:=PrimeOmega[n]==2;

%t Select[Range[10000],And@@semi/@bix[#]&]

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange

%o def A371454(n):

%o def f(x,n): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))

%o def A001358(n):

%o m, k = n, f(n,n)

%o while m != k:

%o m, k = k, f(k,n)

%o return m

%o return sum(1<<A001358(i)-1 for i, j in enumerate(bin(n)[:1:-1],1) if j=='1') # _Chai Wah Wu_, Aug 16 2024

%Y Partitions of this type are counted by A101048, squarefree case A002100.

%Y For primes instead of semiprimes we get A326782.

%Y For prime indices instead of binary indices we have A339112, A339113.

%Y The squarefree case is A371453.

%Y A001358 lists semiprimes, squarefree A006881.

%Y A005117 lists squarefree numbers.

%Y A048793 lists binary indices, reverse A272020, length A000120, sum A029931.

%Y A070939 gives length of binary expansion.

%Y A096111 gives product of binary indices.

%Y Cf. A087086, A296119, A302478, A326031, A367905, A368109, A368533, A371450.

%K nonn,base

%O 1,1

%A _Gus Wiseman_, Apr 02 2024