|
|
A372428
|
|
Sum of binary indices of n minus sum of prime indices of n.
|
|
18
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
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.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
|
|
LINKS
|
|
|
FORMULA
|
|
|
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)
|
|
CROSSREFS
|
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
|
|
|
STATUS
|
approved
|
|
|
|