A067433 Triangle in which row n gives trajectory of n under the map k -> k/3 if k is divisible by 3, otherwise k -> next multiple of 3, stopping when reaching 1 (the initial term n is not included).
1, 3, 1, 1, 6, 2, 3, 1, 6, 2, 3, 1, 2, 3, 1, 9, 3, 1, 9, 3, 1, 3, 1, 12, 4, 6, 2, 3, 1, 12, 4, 6, 2, 3, 1, 4, 6, 2, 3, 1, 15, 5, 6, 2, 3, 1, 15, 5, 6, 2, 3, 1, 5, 6, 2, 3, 1, 18, 6, 2, 3, 1, 18, 6, 2, 3, 1, 6, 2, 3, 1, 21, 7, 9, 3, 1, 21, 7, 9, 3, 1, 7, 9, 3
Offset: 1
Examples
4 -> 6 -> 2 -> 3 -> 1, so row 4 is 6,2,3,1. Row 5 is the same.
Links
- Cino Hilliard, The x+1 conjecture [Dead link]
Crossrefs
Cf. A080816.
Programs
-
Mathematica
nxt[n_]:=If[Divisible[n,3],n/3,3(Floor[n/3]+1)]; Join[{1},Flatten[ Table[ Rest[ NestWhileList[nxt,i,#!=1&]],{i,30}]]] (* Harvey P. Dale, Sep 16 2012 *)
-
PARI
multxp2(n,m,p) = { print1(1" "); for(j=1,n, x=j; c=0; while(x>1, r = x%m; if(r==0,x=x/m,x=x*p+m-r); print1(x" "); ); ) }
Extensions
Corrected by Harvey P. Dale, Sep 16 2012
Comments