OFFSET
1,1
COMMENTS
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.
EXAMPLE
The terms together with their binary expansions and binary indices begin:
32: 100000 ~ {6}
512: 1000000000 ~ {10}
544: 1000100000 ~ {6,10}
8192: 10000000000000 ~ {14}
8224: 10000000100000 ~ {6,14}
8704: 10001000000000 ~ {10,14}
8736: 10001000100000 ~ {6,10,14}
16384: 100000000000000 ~ {15}
16416: 100000000100000 ~ {6,15}
16896: 100001000000000 ~ {10,15}
16928: 100001000100000 ~ {6,10,15}
24576: 110000000000000 ~ {14,15}
24608: 110000000100000 ~ {6,14,15}
25088: 110001000000000 ~ {10,14,15}
25120: 110001000100000 ~ {6,10,14,15}
1048576: 100000000000000000000 ~ {21}
MAPLE
M:= 26: # for terms < 2^M
P:= select(isprime, [$2..(M+1)/2]): nP:= nops(P):
S:= select(`<`, {seq(seq(P[i]*P[j], i=1..j-1), j=1..nP)}, M+1):
R:= map(proc(s) local i; add(2^(i-1), i=s) end proc, combinat:-powerset(S) minus {{}}):
sort(convert(R, list)); # Robert Israel, Apr 04 2024
MATHEMATICA
bix[n_]:=Join@@Position[Reverse[IntegerDigits[n, 2]], 1];
sqfsemi[n_]:=SquareFreeQ[n]&&PrimeOmega[n]==2;
Select[Range[10000], And@@sqfsemi/@bix[#]&]
PROG
(Python)
(Python)
from math import isqrt
from sympy import primepi, primerange
def A371453(n):
def f(x, n): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
def A006881(n):
m, k = n, f(n, n)
while m != k:
m, k = k, f(k, n)
return m
return sum(1<<A006881(i)-1 for i, j in enumerate(bin(n)[:1:-1], 1) if j=='1') # Chai Wah Wu, Aug 16 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, Apr 02 2024
STATUS
approved