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.
%I A371454 #11 Aug 16 2024 20:48:24 %S A371454 8,32,40,256,264,288,296,512,520,544,552,768,776,800,808,8192,8200, %T A371454 8224,8232,8448,8456,8480,8488,8704,8712,8736,8744,8960,8968,8992, %U A371454 9000,16384,16392,16416,16424,16640,16648,16672,16680,16896,16904,16928,16936,17152 %N A371454 Numbers whose binary indices are all semiprimes. %C A371454 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 A371454 The terms together with their binary expansions and binary indices begin: %e A371454 8: 1000 ~ {4} %e A371454 32: 100000 ~ {6} %e A371454 40: 101000 ~ {4,6} %e A371454 256: 100000000 ~ {9} %e A371454 264: 100001000 ~ {4,9} %e A371454 288: 100100000 ~ {6,9} %e A371454 296: 100101000 ~ {4,6,9} %e A371454 512: 1000000000 ~ {10} %e A371454 520: 1000001000 ~ {4,10} %e A371454 544: 1000100000 ~ {6,10} %e A371454 552: 1000101000 ~ {4,6,10} %e A371454 768: 1100000000 ~ {9,10} %e A371454 776: 1100001000 ~ {4,9,10} %e A371454 800: 1100100000 ~ {6,9,10} %e A371454 808: 1100101000 ~ {4,6,9,10} %t A371454 bix[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; %t A371454 semi[n_]:=PrimeOmega[n]==2; %t A371454 Select[Range[10000],And@@semi/@bix[#]&] %o A371454 (Python) %o A371454 from math import isqrt %o A371454 from sympy import primepi, primerange %o A371454 def A371454(n): %o A371454 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 A371454 def A001358(n): %o A371454 m, k = n, f(n,n) %o A371454 while m != k: %o A371454 m, k = k, f(k,n) %o A371454 return m %o A371454 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 A371454 Partitions of this type are counted by A101048, squarefree case A002100. %Y A371454 For primes instead of semiprimes we get A326782. %Y A371454 For prime indices instead of binary indices we have A339112, A339113. %Y A371454 The squarefree case is A371453. %Y A371454 A001358 lists semiprimes, squarefree A006881. %Y A371454 A005117 lists squarefree numbers. %Y A371454 A048793 lists binary indices, reverse A272020, length A000120, sum A029931. %Y A371454 A070939 gives length of binary expansion. %Y A371454 A096111 gives product of binary indices. %Y A371454 Cf. A087086, A296119, A302478, A326031, A367905, A368109, A368533, A371450. %K A371454 nonn,base %O A371454 1,1 %A A371454 _Gus Wiseman_, Apr 02 2024