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.

A252736 a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 21 2014

Keywords

Comments

Consider the binary tree illustrated in A005940: If we start from any n, computing successive iterations of A252463 until 1 is reached (i.e., we are traversing level by level towards the root of the tree, starting from that vertex of the tree where n is located), a(n) gives the number of even numbers > 2 encountered on the path (i.e., excluding the 2 from the count but including the starting n if it was even).
The number of pairs in any factorization tree of n. For example, a possible factorization tree of 12 is 12 -> (4*3) -> (2*2)*3. There are 2 pairs in this factor tree: (4*3) and (2*2). Thus, a(12) - 1 = 3 - 1 = 2. - Melvin Peralta, Aug 29 2016

Crossrefs

Essentially one less than A001222.
Cf. also A246370.

Programs

  • Mathematica
    a[1] = a[2] = 0; a[n_] := a[n] = If[EvenQ@ n, 1 + a[n/2], a[Times @@ Power[Which[# == 1, 1, # == 2, 1, True, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger@ n]]; Array[a, 120] (* Michael De Vlieger, Aug 30 2016 *)

Formula

a(1) = a(2) = 0; for n > 2: a(2n) = 1 + a(n), a(2n+1) = a(A064989(2n+1)).
a(n) = A080791(A243071(n)). [Number of nonleading 0-bits in A243071(n).]
Other identities. For all n >= 2:
a(n) = A000120(A156552(n)) - 1. [One less than the binary weight of A156552(n).]
a(n) = A252464(n) - A252735(n) - 1.
a(n) = A001222(n) - 1.