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.
%I A317753 #19 Aug 19 2018 06:20:54 %S A317753 0,1,13,2,10,14,18,3,7,11,53,15,19,19,23,4,27,8,50,12,73,54,16,16,58, %T A317753 20,20,20,43,24,24,5,47,28,325,9,70,51,32,13,13,74,272,55,55,17,17,17, %U A317753 276,59,40,21,40,21,21,21,63,44,63 %N A317753 Number of steps to reach 1 in 7x+-1 problem, or -1 if 1 is never reached. %C A317753 The 7x+-1 problem is as follows. Start with any natural number n. If 4 divides n-1, multiply it by 7 and add 1; if 4 divides n+1, multiply it by 7 and subtract 1; otherwise divide it by 2. The 7x+-1 problem concerns the question whether we always reach 1. %C A317753 The number of steps to reach 1 is also called the total stopping time. %C A317753 Also the least positive k for which the iterate A317640^k(n) = 1. %H A317753 David Barina, <a href="/A317753/b317753.txt">Table of n, a(n) for n = 1..10000</a> %H A317753 D. Barina, <a href="https://arxiv.org/abs/1807.00908">7x+-1: Close Relative of Collatz Problem</a>, arXiv:1807.00908 [math.NT], 2018. %H A317753 K. Matthews, <a href="http://www.numbertheory.org/php/barina.html">David Barina's 7x+1 conjecture</a>. %e A317753 a(5)=10 because the trajectory of 5 is (5, 36, 18, 9, 64, 32, 16, 8, 4, 2, 1). %t A317753 f[n_] := Switch[Mod[n, 4], 0, n/2, 1, 7 n + 1, 2, n/2, 3, 7 n - 1]; a[n_] := Length@NestWhileList[f, n, # > 1 &] - 1; Array[a, 70] (* _Robert G. Wilson v_, Aug 07 2018 *) %o A317753 (C) %o A317753 int a(int n) { %o A317753 int s = 0; %o A317753 while( n != 1 ) { %o A317753 switch(n%4) { %o A317753 case 1: n = 7*n+1; break; %o A317753 case 3: n = 7*n-1; break; %o A317753 default: n = n/2; %o A317753 } %o A317753 s++; %o A317753 } %o A317753 return s; %o A317753 } %o A317753 (PARI) a(n) = my(nb=0); while(n != 1, if (!((n-1)%4), n = 7*n+1, if (!((n+1)%4), n = 7*n-1, n = n/2)); nb++); nb; \\ _Michel Marcus_, Aug 06 2018 %Y A317753 Cf. A317640 (7x+-1 function), A006577 (3x+1 equivalent). %K A317753 nonn,easy,hear,look %O A317753 1,3 %A A317753 _David Barina_, Aug 06 2018