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.
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
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.
Comments