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.

A329263 Irregular triangle read by rows in which row n is the result of iterating the operation f(n) = n/8 if n == 0 (mod 8), otherwise f(n) = 8*(floor(n/8) + n + 1), terminating at the first occurrence of 1.

Original entry on oeis.org

1, 2, 24, 3, 32, 4, 40, 5, 48, 6, 56, 7, 64, 8, 1, 3, 32, 4, 40, 5, 48, 6, 56, 7, 64, 8, 1, 4, 40, 5, 48, 6, 56, 7, 64, 8, 1, 5, 48, 6, 56, 7, 64, 8, 1, 6, 56, 7, 64, 8, 1, 7, 64, 8, 1, 8, 1, 9, 88, 11, 104, 13, 120, 15, 136, 17, 160, 20, 184, 23, 208
Offset: 1

Views

Author

Davis Smith, Nov 09 2019

Keywords

Comments

The operation f(n) can be generalized to C(n,m) = n/m if n == 0 (mod m), m*(floor(n/m) + n + 1) otherwise. The operation for the 3x+1 (Collatz) problem is equivalent to C(n,2) and f(n) = C(n,8).
Conjecture: For any initial value of n >= 1 there is a number k such that f^{k}(n) = 1; in other words, every row of the triangle is finite.

Examples

			The irregular array a(n,k) starts:
n\k   0   1   2   3   4    5   6    7   8    9  10  11  12  13 ...
1:    1
2:    2  24   3  32   4   40   5   48   6   56   7  64   8   1
3:    3  32   4  40   5   48   6   56   7   64   8   1
4:    4  40   5  48   6   56   7   64   8    1
5:    5  48   6  56   7   64   8    1
6:    6  56   7  64   8    1
7:    7  64   8   1
8:    8   1
9:    9  88  11 104  13  120  15  136  17  160  20 184  23 208 ...
10:  10  96  12 112  14  128  16    2  24    3  32   4  40   5 ...
a(9,100) = 1 and a(10,20) = 1.
		

Crossrefs

Cf. A070165.

Programs

  • PARI
    collatz8(n)=N=[n];while(n>1,N=concat(N,n=if(n%8,8*(floor(n/8)+n+1),n/8)));N

Formula

a(n,0) = n, a(n,k + 1) = a(n,k)/8 if a(n,k) == 0 (mod 8), 8*(floor(a(n,k)/8) + a(n,k) + 1) otherwise, for n >= 1.