OFFSET
1,1
COMMENTS
The sequence is the flattened form of an irregular table T(i, j) (see the example below) which has rows i >= 1 consisting of subsequences of varying length as defined by the following algorithm:
j := 1; T(i, j) := 4 * i - 1;
while T(i, j) is divisible by 3 do
T(i, j + 1) := T(i, j) / 3;
T(i, j + 2) := T(i, j + 1) * 2;
j := j + 2;
end while
The algorithm always stops.
The first rows which are longer than any previous row are 1, 7, 61, 547, 4921 ... (A066443).
Property: The sequence is a permutation of the natural numbers > 0.
Proof: (Start)
The values in the columns j of T for row indexes i of the form i = e * k + f,
k >= 0, if such columns are present, have the following residues modulo some power of 2:
j | Op. | Form of i | T(i, j) | Residues | Residues not yet covered
--+------+ -------------+--------------+------------+-------------------------
1 | | 1 * k + 1 | 4 * k + 3 | 3 mod 4 | 0, 1, 2 mod 4
2 | / 3 | 3 * k + 1 | 4 * k + 1 | 1 mod 4 | 0, 2, 4, 6 mod 8
3 | * 2 | 3 * k + 1 | 8 * k + 2 | 2 mod 8 | 0, 4, 6 mod 8
4 | / 3 | 9 * k + 7 | 8 * k + 6 | 6 mod 8 | 0, 4, 8, 12 mod 16
5 | * 2 | 9 * k + 7 | 16 * k + 12 | 12 mod 16 | 0, 4, 8 mod 16
6 | / 3 | 27 * k + 7 | 16 * k + 4 | 4 mod 16 | 0, 8, 16, 24 mod 32
7 | * 2 | 27 * k + 7 | 32 * k + 8 | 8 mod 32 | 0, 16, 24 mod 32
8 | / 3 | 81 * k + 61 | 32 * k + 24 | 24 mod 32 | 0, 16, 32, 48 mod 64
9 | * 2 | 81 * k + 61 | 64 * k + 48 | 48 mod 64 | 0, 16, 32 mod 64
..| ... | e * k + f | g * k + m | m mod g | 0, ...
The variables in the last, general line can be computed from the operations in the algorithm. They are the following:
e = 3^floor(j / 2)
g = 2^floor((j + 3) / 2)
The residues m in each column and therefore the T(i, j) are all disjoint. For numbers which contain a sufficiently high power of 3, the length of the rows in T grows beyond any limit, and the numbers containing any power of 2 will finally be covered.
(End)
All numbers > 0 up to and including 2^(2*j + 1) appear in the rows in T up to and including A066443(j). For example, 4096 and 8192 are the trailing elements in row 398581 = A066443(6).
From Georg Fischer, Oct 16 2020: (Start)
Whenever a row of T is longer than any previous rows, it defines the start values of the arithmetic progressions in the additional columns. These start values form the sequence A308709.
There is a hierarchy of such permutations of the positive integers derived by selecting and mapping the terms of the form 6*k - 2 to k:
Level 0: A307407, nodes in the graph of the "3x+1" or Collatz problem
Level >= 4: A000027, the positive integers
Conjectures (verified for k = 0..11):
a(A338186(k)) = 4^k.
(End)
LINKS
EXAMPLE
Table T(i, j) begins:
i\j 1 2 3 4 5 6 7
-------------------------
1: 3 1 2
2: 7
3: 11
4: 15 5 10
5: 19
6: 23
7: 27 9 18 6 12 4 8
MAPLE
T:= proc(n) local m, l; m:= 4*n-1; l:= m;
while irem(m, 3, 'm')=0 do
l:= l, m; m:= m*2; l:=l, m;
od; l
end:
seq(T(n), n=1..40); # Alois P. Heinz, Dec 10 2018
MATHEMATICA
s={}; Do[a=4n-1; AppendTo[s, a]; While[Divisible[a, 3], a/=3; AppendTo[s, a]; a*=2; AppendTo[s, a]], {n, 1, 30}]; s (* Amiram Eldar, Dec 10 2018 *)
PROG
(PARI) apply( A322469_row(n, L=[n=4*n+3])={while(n%3==0, L=concat(L, [n\=3, n*=2])); L}, [0..99]) \\ Use concat(%) to flatten the table if desired. - M. F. Hasler, Dec 10 2018
(Perl) use integer; my $n = 1; my $i = 1;
while ($i <= 1000) { # next row
my $an = 4 * $i - 1; print "$n $an\n"; $n ++;
while ($an % 3 == 0) {
$an /= 3; print "$n $an\n"; $n ++;
$an *= 2; print "$n $an\n"; $n ++;
} # while divisible by 3
$i ++;
} # while next row - Georg Fischer, Dec 12 2018
(Sage)
def A322469_list(len):
L = []
for n in (1..len):
a = 4*n - 1
L.append(a)
while 3.divides(a):
a //= 3
L.append(a)
a <<= 1
L.append(a)
return L
A322469_list(28) # Peter Luschny, Dec 10 2018
CROSSREFS
KEYWORD
nonn,tabf,easy
AUTHOR
Georg Fischer, Dec 09 2018
STATUS
approved