A233272 a(n) = n + 1 + number of nonleading zeros in binary representation of n (A080791).
1, 2, 4, 4, 7, 7, 8, 8, 12, 12, 13, 13, 15, 15, 16, 16, 21, 21, 22, 22, 24, 24, 25, 25, 28, 28, 29, 29, 31, 31, 32, 32, 38, 38, 39, 39, 41, 41, 42, 42, 45, 45, 46, 46, 48, 48, 49, 49, 53, 53, 54, 54, 56, 56, 57, 57, 60, 60, 61, 61, 63, 63, 64, 64, 71, 71, 72
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..8192
- Christian Krause, et al, A mined LODA assembly source for this sequence
- Index entries for sequences related to binary expansion of n
Crossrefs
Programs
-
Mathematica
DigitCount[#, 2, 0] + # + 1 & [Range[0, 100]] (* Paolo Xausa, Mar 01 2024 *)
-
PARI
A233272(n) = { my(s=1); while(n, n>>=1; s+=(1+n)); (s); }; \\ (After a LODA-assembly program found by a miner) - Antti Karttunen, Jan 30 2022
-
Scheme
(define (A233272 n) (+ 1 n (A080791 n))) ;; Alternatively: (define (A233272 n) (if (zero? n) 1 (+ n (A000120 (A054429 n)))))
Formula
a(n) = n + A080791(n) + 1.
a(0) = 1; for n > 1, a(n) = 1 + floor(n/2) + a(floor(n/2)). - (Found by LODA miner, see comments) - Antti Karttunen, Jan 30 2022
Comments