OFFSET
1,6
COMMENTS
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
EXAMPLE
The binary indices of 65 are {1,7}, and the prime indices are {3,6}, so a(65) = 8 - 9 = -1.
MATHEMATICA
prix[n_]:=If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]];
bix[n_]:=Join@@Position[Reverse[IntegerDigits[n, 2]], 1];
Table[Total[bix[n]]-Total[prix[n]], {n, 100}]
PROG
(Python)
from itertools import count, islice
from sympy import sieve, factorint
def a_gen():
for n in count(1):
b = sum((i+1) for i, x in enumerate(bin(n)[2:][::-1]) if x =='1')
p = sum(sieve.search(i)[0] for i in factorint(n, multiple=True))
yield(b-p)
A372428_list = list(islice(a_gen(), 83)) # John Tyler Rascoe, May 04 2024
(Python)
from sympy import primepi, factorint
def A372428(n): return int(sum(i for i, j in enumerate(bin(n)[:1:-1], 1) if j=='1')-sum(primepi(p)*e for p, e in factorint(n).items())) # Chai Wah Wu, Oct 18 2024
CROSSREFS
Positions of zeros are A372427.
For minimum instead of sum we have A372437.
A003963 gives product of prime indices.
A070939 gives length of binary expansion.
A096111 gives product of binary indices.
A326031 gives weight of the set-system with BII-number n.
KEYWORD
sign,base
AUTHOR
Gus Wiseman, May 02 2024
STATUS
approved