cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A375961 2-adic valuation of 6*n + 2.

Original entry on oeis.org

1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 6, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 9, 1
Offset: 0

Views

Author

Ruud H.G. van Tol, Sep 04 2024

Keywords

Comments

6*i+2 is the first (3*x+1)/2 successor of 4*i+1, with i >= 0.
The first occurrence of odd t is before that of t-1.

Examples

			a(21) = A007814(6*21+2) = 7.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerExponent[6*n + 2, 2]; Array[a, 100, 0] (* Amiram Eldar, Sep 04 2024 *)
  • PARI
    a(n) = valuation(6*n+2, 2);
    
  • Python
    def A375961(n): return (~(3*n+1)&3*n).bit_length()+1 # Chai Wah Wu, Sep 27 2024

Formula

a(n) = A007814(6*n + 2).
a(n) = A371093(n) + 1.
a(n) = A087229(n) - 1.
a(n) = k for n == A096773(k) (mod 2^k), k >= 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Oct 01 2024