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 A329480 #79 Oct 16 2023 09:27:39 %S A329480 0,1,0,2,-1,3,1,4,-2,5,0,6,-3,7,2,8,-4,9,-1,10,-5,11,3,12,-6,13,1,14, %T A329480 -7,15,4,16,-8,17,-2,18,-9,19,5,20,-10,21,0,22,-11,23,6,24,-12,25,-3, %U A329480 26,-13,27,7,28,-14,29,2,30,-15,31,8,32,-16,33,-4,34,-17 %N A329480 a(n) = (1 - A075677(n))/6 if 6|(A075677(n)-1) or a(n) = (A075677(n) + 1)/6 if 6|(A075677(n)+1). %C A329480 A fractal sequence. %C A329480 This sequence is related to the Collatz Problem and can be illustrated on a logarithmic spiral to determine the odd numbers in the trajectory of a natural number of the form 6x+1 or 6x-1 simply by moving forward if the integer is positive, backward if the integer is negative, and continuing this forward-backward movement indefinitely. %C A329480 When formatted as a table T with 4 columns, the third column T(n,3) is equal to the sequence. - _Ruud H.G. van Tol_, Oct 16 2023 %H A329480 Ruud H.G. van Tol, <a href="/A329480/b329480.txt">Table of n, a(n) for n = 1..10000</a> %H A329480 Commons.Wikimedia <a href="https://commons.wikimedia.org/wiki/File:Integer_Spiral.png">Integer Spiral</a> %H A329480 Fabian S. Reid, <a href="https://arxiv.org/abs/2105.07955">The Visual Pattern in the Collatz Conjecture and Proof of No Non-Trivial Cycles</a>, arXiv:2105.07955 [math.GM], 2021. %F A329480 a(n) = (1 - A075677(n))/6 when 1 = A075677(n) mod 6, or %F A329480 a(n) = (A075677(n) + 1)/6 when 5 = A075677(n) mod 6. %F A329480 From _Ruud H.G. van Tol_, Oct 16 2023: (Start) %F A329480 a(4*n-1) = a(n). %F A329480 T(n,1) = 1-n; T(n,2) = 2*n-1 = n - T(n,1); T(n,3) = T(floor((n-1)/4) + 1, (n-1) mod 4 + 1) = a(n); T(n,4) = 2*n = T(n,2) + 1. (End) %e A329480 For n = 2, A075677(2) = 5, so a(2) = 1. %e A329480 For n = 9, A075677(9) = 13, so a(9) = -2. %e A329480 From _Ruud H.G. van Tol_, Oct 16 2023: (Start) %e A329480 Array T begins: %e A329480 n|k_1|__2|__3|__4| %e A329480 1| 0 1 0 2 %e A329480 2| -1 3 1 4 %e A329480 3| -2 5 0 6 %e A329480 4| -3 7 2 8 %e A329480 5| -4 9 -1 10 %e A329480 6| -5 11 3 12 %e A329480 ... (End) %t A329480 nterms=100;Table[r=(c=3(2n-1)+1)/2^IntegerExponent[c,2];If[Mod[r,6]==1,(1-r)/6,(1+r)/6],{n, nterms}] (* _Paolo Xausa_, Nov 28 2021 *) %o A329480 (PARI) a(n) = my(x=3*n-1); x>>=valuation(x, 2); if(1==x%6, 1-x, 1+x)/6; \\ _Ruud H.G. van Tol_, Oct 16 2023 %Y A329480 Cf. A002450, A016789, A075677, A096773, A349414. %K A329480 sign %O A329480 1,4 %A A329480 _Fabian S. Reid_, Jun 07 2020