A372428 Sum of binary indices of n minus sum of prime indices of n.
1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 3, 2, 4, 5, 1, -1, 2, 0, 3, 3, 4, 2, 4, 4, 4, 6, 6, 3, 8, 4, 1, 0, 0, 2, 3, -2, 2, 4, 4, -2, 5, -1, 6, 7, 5, 1, 5, 4, 6, 5, 6, -1, 9, 9, 8, 6, 6, 1, 11, 1, 8, 13, 1, -1, 1, -9, 1, 0, 4, -7, 4, -9, 0, 6, 4, 6, 7, -5, 5, 5, 0, -8
Offset: 1
Examples
The binary indices of 65 are {1,7}, and the prime indices are {3,6}, so a(65) = 8 - 9 = -1.
Links
- John Tyler Rascoe, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
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}]
-
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
Comments