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.

A330732 a(n) is the smallest number whose odd hailstone sequence has length n (including 1 and itself) and is in descending order.

Original entry on oeis.org

1, 5, 13, 17, 45, 241, 321, 1713, 9137, 24365, 36033, 173261, 231681, 630033, 1642769, 4380717, 11715629, 31241677, 41655569, 111081517, 148108689, 789913009, 1053217345, 1404289793, 3744772781, 9986060749, 13314747665, 35505993773, 94682650061, 128599099649
Offset: 1

Views

Author

Xiangyu Chen, Dec 28 2019

Keywords

Comments

The hailstone (Collatz) sequence of a number is defined by repeated operations of f(x), where f(x)=x/2 if x is even, and f(x)=3x+1 if x is odd. The odd numbers of a number's hailstone sequence are also called its odd hailstone sequence.
The odd hailstone sequence of 45 [45, 17, 13, 5, 1] contains the first five terms of this sequence.
Note that a(n+1) isn't necessarily greater than a(n).

Examples

			Consider a(8): [1713, 1285, 241, 181, 17, 13, 5, 1]; the odd hailstone sequence of 1713 is descending and has length 8. 1713 is the lowest such number.
		

Crossrefs

Programs

  • Mathematica
    With[{s = Array[If[AllTrue[Differences@ #, # < 0 &], Length@ #, 0] &@ Select[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, #, # > 1 &], OddQ] &, 10^5]}, Array[FirstPosition[s, #][[1]] &, Max@ s]] (* Michael De Vlieger, Jan 01 2020 *)
  • PARI
    is(k, n) = {my(x=k, v=List([])); while(x>1, if(x%2==0, x=x/2, listput(v, x); x=3*x+1)); 1+#v==n&&v==vecsort(v, , 4); }
    a(n) = {k=1; while(is(k, n)==0, k+=2); k; } \\ Jinyuan Wang, Dec 31 2019

Extensions

a(23)-a(30) from Kevin P. Thompson, Jul 23 2022