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.

A375782 The 2-adic valuation of the result, starting from n, of Collatz steps x -> (3x+1)/2 while odd.

Original entry on oeis.org

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

Views

Author

Ruud H.G. van Tol, Aug 28 2024

Keywords

Comments

The number of steps is A007814(n+1) and their result is 2*A085062(n).
a(n) = 1 iff A085062(n) is odd, which is when n+1 is in A338691.

Examples

			7 -> 11 -> 17 -> 26, so a(7) = A007814(26) = 1.
		

Crossrefs

Programs

  • PARI
    a(n)= valuation((3/2)^valuation(n+1, 2)*(n+1)-1, 2);

Formula

For n == 0 (mod 2), a(n) = A007814(n).
For k > 0, a(2^k-1) = A007814(3^k-1).
a(n) = 1 + A007814(A085062(n)).