login
A285717
a(n) = A007814(n) + A159918(n) = A007814(n) + A000120(n^2).
4
1, 2, 2, 3, 3, 3, 3, 4, 3, 4, 5, 4, 4, 4, 4, 5, 3, 4, 5, 5, 6, 6, 3, 5, 5, 5, 6, 5, 5, 5, 5, 6, 3, 4, 5, 5, 6, 6, 7, 6, 5, 7, 7, 7, 8, 4, 4, 6, 5, 6, 5, 6, 8, 7, 7, 6, 6, 6, 7, 6, 6, 6, 6, 7, 3, 4, 5, 5, 6, 6, 7, 6, 6, 7, 9, 7, 7, 8, 5, 7, 6, 6, 8, 8, 7, 8, 7, 8, 9, 9, 5, 5, 6, 5, 5, 7, 5, 6, 6, 7, 9, 6, 7, 7, 6, 9, 8, 8, 8, 8, 4, 7, 7, 7, 8, 7, 9, 8, 8, 7
OFFSET
1,2
FORMULA
a(n) = A007814(n) + A159918(n) = A007814(n) + A000120(n^2).
a(n) = A007814(n*A201555(n)).
MATHEMATICA
Table[IntegerExponent[n, 2] + DigitCount[n^2, 2, 1], {n, 120}] (* Indranil Ghosh, Apr 27 2017 *)
PROG
(Scheme)
(define (A285717 n) (+ (A007814 n) (A159918 n)))
(define (A285717 n) (A007814 (* n (A201555 n))))
(PARI) a(n) = valuation(n, 2) + hammingweight(n^2); \\ Indranil Ghosh, Apr 27 2017
(Python)
import math
def a(n): return int(math.log(n - (n & n - 1), 2)) + bin(n**2)[2:].count("1") # Indranil Ghosh, Apr 27 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 27 2017
STATUS
approved