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.

A213916 Sum of all odd numbers in Collatz (3x+1) trajectory of n.

Original entry on oeis.org

1, 1, 9, 1, 6, 9, 54, 1, 63, 6, 47, 9, 19, 54, 132, 1, 36, 63, 95, 6, 22, 47, 117, 9, 120, 19, 20262, 54, 76, 132, 20194, 1, 153, 36, 94, 63, 91, 95, 450, 6, 20235, 22, 248, 47, 81, 117, 20163, 9, 140, 120, 204, 19, 59, 20262, 20426, 54, 305, 76, 411, 132, 178
Offset: 1

Views

Author

Jayanta Basu, Mar 05 2013

Keywords

Examples

			a(5)=6 since Collatz trajectory of 5 is 5,16,8,4,2,1.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Total[Select[Collatz[n], OddQ]], {n, 100}] (* T. D. Noe, Mar 05 2013 *)

Formula

a(n) = A033493(n) - A213909(n).