OFFSET
1,3
COMMENTS
Also numbers whose binary expansion and reversed binary expansion have the same sum of partial sums.
Also numbers whose average position of a 1 in their binary expansion is (c+1)/2, where c is the number of digits.
Conjecture: Also numbers whose binary expansion has as least squares fit a line of zero slope, counted by A222955.
EXAMPLE
The binary expansion of 70 is (1,0,0,0,1,1,0), with positions of 1's {1,5,6}, while the reverse positions are {2,3,7}. Both sum to 12, so 70 is in the sequence.
MATHEMATICA
Select[Range[0, 100], #==0||Mean[Join@@Position[IntegerDigits[#, 2], 1]]==(IntegerLength[#, 2]+1)/2&]
PROG
(Python)
from functools import reduce
from itertools import count, islice
def A359402_gen(startvalue=0): # generator of terms
return filter(lambda n:(r:=reduce(lambda c, d:(c[0]+d[0]*(e:=int(d[1])), c[1]+e), enumerate(bin(n)[2:], start=1), (0, 0)))[0]<<1==(n.bit_length()+1)*r[1], count(max(startvalue, 0)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 05 2023
STATUS
approved