A324468 a(n) = r(n) + r(n+1) + r(n+2), where r(n) is the ruler sequence A007814.
1, 3, 2, 3, 1, 4, 3, 4, 1, 3, 2, 3, 1, 5, 4, 5, 1, 3, 2, 3, 1, 4, 3, 4, 1, 3, 2, 3, 1, 6, 5, 6, 1, 3, 2, 3, 1, 4, 3, 4, 1, 3, 2, 3, 1, 5, 4, 5, 1, 3, 2, 3, 1, 4, 3, 4, 1, 3, 2, 3, 1, 7, 6, 7, 1, 3, 2, 3, 1, 4, 3, 4, 1, 3, 2, 3, 1, 5, 4, 5, 1, 3, 2, 3, 1
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[&+[Valuation(n+k, 2): k in [0..2]]: n in [1..70]]; // Vincenzo Librandi, Mar 10 2019
-
Mathematica
Table[Sum[IntegerExponent[n + k, 2], {k, 0, 2}], {n, 100}] (* Vincenzo Librandi, Mar 10 2019 *)
-
PARI
a(n) = sum(k=0, 2, valuation(n+k, 2)); \\ Michel Marcus, Mar 10 2019
-
Python
def A324468(n): return (~n & n-1).bit_length()+(~(n+1) & n).bit_length()+(~(n+2) & n+1).bit_length() # Chai Wah Wu, Jul 01 2022
Formula
1 <= a(n) <= 1 + log_2(n+2). - Charles R Greathouse IV, Jul 01 2022
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3. - Amiram Eldar, Sep 10 2024