|
|
A064547
|
|
Sum of binary digits (or count of 1-bits) in the exponents of the prime factorization of n.
|
|
79
|
|
|
0, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 2, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 2, 3, 2, 2, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,6
|
|
COMMENTS
|
This sequence is different from A058061 for n containing 6th, 8th, ..., k-th powers in its prime decomposition, where k runs through the integers missing from A064548.
Number of Fermi-Dirac factors of n. - Peter Munn, Dec 27 2019
|
|
LINKS
|
|
|
FORMULA
|
(End)
a(n^2) = a(n).
Alternative definition: a(1) = 0; a(n * m) = a(n) + 1 for m = A050376(k) > A223491(n).
(End)
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761) and C = Sum_{p prime} f(1/p) = 0.13605447049622836522..., where f(x) = -x + Sum_{k>=0} x^(2^k)/(1+x^(2^k)). - Amiram Eldar, Sep 28 2023
|
|
EXAMPLE
|
For n = 54, n = 2^1 * 3^3 with exponents (1) and (11) in binary, so a(54) = A000120(1) + A000120(3) = 1 + 2 = 3.
|
|
MAPLE
|
expts:=proc(n) local t1, t2, t3, t4, i; if n=1 then RETURN([0]); fi; if isprime(n) then RETURN([1]); fi; t1:=ifactor(n); if nops(factorset(n))=1 then RETURN([op(2, t1)]); fi; t2:=nops(t1); t3:=[]; for i from 1 to t2 do t4:=op(i, t1); if nops(t4) = 1 then t3:=[op(t3), 1]; else t3:=[op(t3), op(2, t4)]; fi; od; RETURN(t3); end;
A000120 := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
LamMos:= proc(n) local t1, t2, t3, i; t1:=expts(n); add( A000120(t1[i]), i=1..nops(t1)); end; # N. J. A. Sloane, Dec 20 2007
# alternative Maple program:
F:= ifactors(n)[2];
add(convert(convert(f[2], base, 2), `+`), f=F)
end proc:
|
|
MATHEMATICA
|
Table[Plus@@(DigitCount[Last/@FactorInteger[k], 2, 1]), {k, 105}]
|
|
PROG
|
(PARI) SumD(x)= { local(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(s + x) }
baseE(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) }
{ for (n=1, 2000, f=factor(n)~; a=0; for (i=1, length(f), a+=SumD(baseE(f[2, i], 2))); write("b064547.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 18 2009
(PARI) a(n) = {my(f = factor(n)[, 2]); sum(k=1, #f, hammingweight(f[k])); } \\ Michel Marcus, Feb 10 2016
(Haskell)
a064547 1 = 0
(Scheme, two variants, both using memoizing-macro definec)
(Python)
from sympy import factorint
def wt(n): return bin(n).count("1")
def a(n):
f=factorint(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|