A322469 Irregular table: row i = 1, 2, 3, ... starts with 4*i - 1; then, as long as the number is divisible by 3, the next two terms are the result of dividing it by 3, then multiplying it by 2.
3, 1, 2, 7, 11, 15, 5, 10, 19, 23, 27, 9, 18, 6, 12, 4, 8, 31, 35, 39, 13, 26, 43, 47, 51, 17, 34, 55, 59, 63, 21, 42, 14, 28, 67, 71, 75, 25, 50, 79, 83, 87, 29, 58, 91, 95, 99, 33, 66, 22, 44, 103, 107, 111, 37, 74
Offset: 1
Examples
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
Links
Crossrefs
Programs
-
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 *)
-
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
Comments