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.

A213917 Difference between sum of all even and the sum of all odd numbers in Collatz (3x+1) trajectory of n.

Original entry on oeis.org

-1, 1, 31, 5, 24, 37, 180, 13, 213, 34, 165, 49, 81, 194, 430, 29, 142, 231, 329, 54, 104, 187, 399, 73, 418, 107, 60916, 222, 290, 460, 60716, 61, 535, 176, 352, 267, 353, 367, 1444, 94, 60861, 146, 842, 231, 335, 445, 60653, 121, 526, 468, 722, 159, 281
Offset: 1

Views

Author

Jayanta Basu, Mar 05 2013

Keywords

Crossrefs

Programs

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

Formula

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