OFFSET
1,4
COMMENTS
A fractal sequence.
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.
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
LINKS
Ruud H.G. van Tol, Table of n, a(n) for n = 1..10000
Commons.Wikimedia Integer Spiral
Fabian S. Reid, The Visual Pattern in the Collatz Conjecture and Proof of No Non-Trivial Cycles, arXiv:2105.07955 [math.GM], 2021.
FORMULA
From Ruud H.G. van Tol, Oct 16 2023: (Start)
a(4*n-1) = a(n).
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)
EXAMPLE
For n = 2, A075677(2) = 5, so a(2) = 1.
For n = 9, A075677(9) = 13, so a(9) = -2.
From Ruud H.G. van Tol, Oct 16 2023: (Start)
Array T begins:
n|k_1|__2|__3|__4|
1| 0 1 0 2
2| -1 3 1 4
3| -2 5 0 6
4| -3 7 2 8
5| -4 9 -1 10
6| -5 11 3 12
... (End)
MATHEMATICA
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 *)
PROG
(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
CROSSREFS
KEYWORD
sign
AUTHOR
Fabian S. Reid, Jun 07 2020
STATUS
approved