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.

Showing 1-2 of 2 results.

A078419 Numbers n such that h(n) = 2 h(n-1) where h(n) is the length of the sequence {n, f(n), f(f(n)), ...., 1} in the Collatz (or 3x + 1) problem. (The earliest "1" is meant.)

Original entry on oeis.org

2, 5, 22, 495, 559, 2972, 3092, 3124, 3147, 3153, 3184, 3367, 3711, 3748, 3857, 3921, 3982, 4450, 4767, 17019, 17708, 17769, 17771, 17782, 17796, 17825, 17835, 17857, 17863, 17892, 18079, 18082, 18139, 18298, 18422, 18580, 18644, 18688, 18784
Offset: 1

Views

Author

Joseph L. Pe, Dec 29 2002

Keywords

Comments

Recall that f(n) = n/2 if n is even; = 3n + 1 if n is odd.

Examples

			n, f(n), f(f(n)), ...., 1 for n = 22, 21, respectively, are: 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1; 21, 64, 32, 16, 8, 4, 2, 1. Hence h(22) = 16 = 2 * 8 = h(21) and 22 belongs to the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[EvenQ[n], n/2, 3n+1]; h[n_] := Module[{a, i}, i=n; a=1; While[i>1, a++; i=f[i]]; a]; Select[Range[2, 18800], 2h[ #-1]==h[ # ]&]

Extensions

Extended by Robert G. Wilson v, Dec 30 2002

A078420 Numbers n such that h(n) = 3 h(n-1) where h(n) is the length of the sequence {n, f(n), f(f(n)), ...., 1} in the Collatz (or 3x + 1) problem. (The earliest "1" is meant.)

Original entry on oeis.org

105, 548, 683, 1508, 3652, 4278, 4295, 8145, 8150, 9417, 9419, 18247, 18287, 18370, 18433, 18586, 18695, 18706, 18742, 18945, 22024, 22140, 22311, 22324, 22708, 22714, 25336, 25681, 25771, 25777, 25785, 25814, 44545, 44593, 46505, 46847
Offset: 1

Views

Author

Joseph L. Pe, Dec 29 2002

Keywords

Comments

Recall that f(n) = n/2 if n is even; = 3n + 1 if n is odd.

Examples

			n, f(n), f(f(n)), ...., 1 for n = 105, 104, respectively, are: 105, 316, 158, 79, 238, 119, 358, 179, 538, 269, 808, 404, 202, 101, 304, 152, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1; 104, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, of lengths 39 = 3 x 13 and 13, respectively. Hence 105 belongs to the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[EvenQ[n], n/2, 3n+1]; h[n_] := Module[{a, i}, i=n; a=1; While[i>1, a++; i=f[i]]; a]; Select[Range[2, 47000], 3h[ #-1]==h[ # ]&]
    Flatten[Position[Partition[Table[Length[NestWhileList[If[EvenQ[#],#/2, 3#+1]&, n, #>1&]],{n,50000}],2,1],?(3#[[1]]==#[[2]]&),1,Heads-> False]]+1 (* _Harvey P. Dale, Apr 07 2018 *)

Extensions

Extended by Robert G. Wilson v, Dec 30 2002
Showing 1-2 of 2 results.