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.

A386885 a(n) is the number of iterations that -n requires to reach 1 under the map x -> -x/2 if x is even, 3x + 1 if x is odd.

This page as a plain text file.
%I A386885 #50 Aug 18 2025 23:39:02
%S A386885 2,1,4,4,10,13,13,3,16,6,6,6,45,9,9,6,48,12,12,12,25,51,51,15,15,15,
%T A386885 15,15,41,54,54,5,18,18,18,18,31,44,44,8,57,8,8,8,21,21,21,8,34,47,47,
%U A386885 47,60,60,60,11,11,11,11,11,86,24,24,8,37,50,50,50,50,63
%N A386885 a(n) is the number of iterations that -n requires to reach 1 under the map x -> -x/2 if x is even, 3x + 1 if x is odd.
%C A386885 Equivalently, a(n) is the number of iterations that n requires to reach -1 under the map x -> -x/2 if x is even, 3x - 1 if x is odd. This is called the shadow Collatz map in the Ryosuke Miyazawa reference.
%C A386885 Conjecture: Every nonzero integer reaches 1. Verified numerically up to +-5*10^7.
%H A386885 Ryosuke Miyazawa, <a href="https://doi.org/10.5281/zenodo.16754305">The Shadow Collatz Conjecture: The Journey of All Integers Toward -1</a>, preprint, Zenodo, (2025).
%F A386885 a(1) = 2; for n > 1, a(n) = 1 + a(f(n)), where f(n) = -n/2 if n is even, 3n - 1 if n is odd.
%e A386885 n = 7 requires a(7) = 13 steps to reach -1: 7 -> 20 -> -10 -> 5 -> 14 -> -7 -> -22 -> 11 -> 32 -> -16 -> 8 -> -4 -> 2 -> -1.
%p A386885 a:= proc(n) option remember; `if`(n=-1, 0,
%p A386885       1+a(`if`(n::even, -n/2, 3*n-1)))
%p A386885     end:
%p A386885 seq(a(n), n=1..100);  # _Alois P. Heinz_, Aug 13 2025
%t A386885 a[n_]:=Module[{s = 0, m = n},While[m!=-1,s++;m=If[BitAnd[m,1]==1,3*m -1,-m/2]];s];Array[a,70] (* _James C. McMahon_, Aug 18 2025 *)
%o A386885 (PARI)  a(n) = if(n==0, oo, my(s=0); while(n!=-1, s++; n=if(bitand(n,1), 3*n-1, -n/2)); s) \\ _Andrew Howroyd_, Aug 06 2025
%Y A386885 Cf. A006577, A381055, A383131.
%K A386885 nonn
%O A386885 1,1
%A A386885 _Ryosuke Miyazawa_, Aug 06 2025