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.

A087232 a(n) is the largest odd term in the 3x+1 trajectory initiated at n.

This page as a plain text file.
%I A087232 #26 Nov 14 2021 14:12:56
%S A087232 1,1,5,1,5,5,17,1,17,5,17,5,13,17,53,1,17,17,29,5,21,17,53,5,29,13,
%T A087232 3077,17,29,53,3077,1,33,17,53,17,37,29,101,5,3077,21,65,17,45,53,
%U A087232 3077,5,49,29,77,13,53,3077,3077,17,65,29,101,53,61,3077,3077,1,65,33,101,17,69
%N A087232 a(n) is the largest odd term in the 3x+1 trajectory initiated at n.
%C A087232 a(n)=3077 corresponds to peak=9232.
%H A087232 Michael De Vlieger, <a href="/A087232/b087232.txt">Table of n, a(n) for n = 1..10000</a>
%F A087232 If n = 2^k (for integers k >= 0), a(n) = 1; otherwise a(n) = (A025586(n)-1)/3 =(A056959(n)-1)/3. - _Paolo Xausa_, Nov 13 2021
%p A087232 a:= proc(n) option remember; `if`(n=1, 1, max(
%p A087232      `if`(n::odd, n, 0), a(`if`(n::even, n/2, 3*n+1))))
%p A087232     end:
%p A087232 seq(a(n), n=1..88);  # _Alois P. Heinz_, Nov 14 2021
%t A087232 c[x_] := (1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1); c[1]=1; fpl[x_] := Delete[FixedPointList[c, x], -1] ofp[x_] := Part[fpl[x], Flatten[Position[OddQ[fpl[x]], True]]] Table[Max[ofp[w]], {w, 1, 256}]
%t A087232 (* Second program: *)
%t A087232 Array[Max@ Select[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, #, Unequal[#, 1, -1, -10, -34] &, 1, 10^4], OddQ] &, 69] (* _Michael De Vlieger_, May 15 2017, after _Alonso del Arte_ at A025586 *)
%Y A087232 Cf. A025586, A056959, A348006.
%K A087232 nonn
%O A087232 1,3
%A A087232 _Labos Elemer_, Sep 18 2003
%E A087232 Name simplified by _Paolo Xausa_, Nov 13 2021