login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A035531
a(n) = A000120(n) + A001221(n) - 1.
3
0, 1, 2, 1, 2, 3, 3, 1, 2, 3, 3, 3, 3, 4, 5, 1, 2, 3, 3, 3, 4, 4, 4, 3, 3, 4, 4, 4, 4, 6, 5, 1, 3, 3, 4, 3, 3, 4, 5, 3, 3, 5, 4, 4, 5, 5, 5, 3, 3, 4, 5, 4, 4, 5, 6, 4, 5, 5, 5, 6, 5, 6, 7, 1, 3, 4, 3, 3, 4, 5, 4, 3, 3, 4, 5, 4, 5, 6, 5, 3, 3, 4, 4, 5, 5, 5, 6, 4, 4, 6, 6, 5, 6, 6, 7, 3, 3, 4, 5, 4, 4, 6, 5, 4, 6, 5, 5, 5, 5, 7, 7
OFFSET
1,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537 (first 1000 terms from G. C. Greubel)
FORMULA
G.f.: Sum a(n) x^n = Sum A000120(p)*x^p/(1-x^p), p = prime.
MAPLE
A035531 := proc(n)
A000120(n)+A001221(n)-1 ;
end proc:
seq(A035531(n), n=1..100) ; # R. J. Mathar, Mar 12 2018
MATHEMATICA
Table[DigitCount[n, 2, 1] + PrimeNu[n] - 1, {n, 1, 100}] (* G. C. Greubel, Apr 24 2017 *)
PROG
(PARI) a(n) = hammingweight(n) + omega(n) - 1; \\ Michel Marcus, Apr 25 2017
(Python)
from sympy import primefactors
def a(n): return 0 if n<2 else bin(n)[2:].count("1") + len(primefactors(n)) - 1 # Indranil Ghosh, Apr 25 2017
CROSSREFS
Cf. also A336149.
Sequence in context: A136624 A033763 A033803 * A118977 A071766 A007305
KEYWORD
nonn,easy
EXTENSIONS
More terms from David W. Wilson.
STATUS
approved