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.

Showing 1-6 of 6 results.

A338206 Inverse of permutation in A160016.

Original entry on oeis.org

0, 2, 1, 6, 3, 10, 4, 14, 5, 18, 7, 22, 8, 26, 9, 30, 11, 34, 12, 38, 13, 42, 15, 46, 16, 50, 17, 54, 19, 58, 20, 62, 21, 66, 23, 70, 24, 74, 25, 78, 27, 82, 28, 86, 29, 90, 31, 94, 32, 98, 33, 102, 35, 106, 36, 110, 37, 114, 39, 118, 40, 122, 41, 126, 43, 130, 44, 134, 45, 138, 47, 142, 48, 146, 49, 150, 51, 154, 52, 158
Offset: 0

Views

Author

Georg Fischer, Oct 16 2020

Keywords

Comments

Permutation of the nonnegative integers.

Crossrefs

Cf. A160016.

Programs

  • Maple
    gf := (x*(1 + x^2)*(2 + x + 2*x^2 + x^3 + 2*x^4))/((-1 + x)^2*(1 + x)^2*(1 - x + x^2)*(1 + x + x^2)): ser := series(gf, x, 82):
    seq(coeff(ser, x, n), n=0..79); # Peter Luschny, Oct 16 2020
  • Mathematica
    LinearRecurrence[{0,1,0,0,0,1,0,-1}, {0,2,1,6,3,10,4,14},80]
  • PARI
    my(x='x+O('x^80)); Vec((x*(2+x+4*x^2+2*x^3+4*x^4+x^5+2*x^6))/((1-x^2)^2*(1+x^2+x^4)))

Formula

Blocks of 6 numbers: a(6*k+0 .. 6*k+5) = (4*k+0, 12*k+2, 4*k+1, 12*k+6, 4*k+3, 12*k+10) for k >= 0.
O.g.f.: x*(1 + x^2)*(2 + x + 2*x^2 + x^3 + 2*x^4)/((1 - x^2)^2*(1 + x^2 + x^4)).
If n is odd, then a(n) = 2*n; otherwise, a(n) = nearest integer to 2*n/3. - Philippe Deléham, Nov 09 2023

A307048 Permutation of the positive integers derived from the terms of A322469 having the form 6*k - 2.

Original entry on oeis.org

2, 1, 6, 5, 10, 4, 14, 7, 18, 13, 22, 8, 26, 3, 30, 21, 34, 12, 38, 9, 42, 29, 46, 16, 50, 23, 54, 37, 58, 20, 62, 19, 66, 45, 70, 24, 74, 17, 78, 53, 82, 28, 86, 39, 90, 61, 94, 32, 98, 15, 102, 69, 106, 36, 110, 25, 114, 77, 118, 40, 122, 55
Offset: 1

Views

Author

Georg Fischer, Mar 21 2019

Keywords

Comments

The sequence is the flattened form of an irregular table U(i, j) similar to table T(i, j) in A322469. U(i, j) = k is defined only for the elements T(i, j) which have the form 6*k - 2, so the table is sparsely filled.
Like in A322469, the columns in table U contain arithmetic progressions.
a(n) is a permutation of the positive integers, since A322469 is one, and since there is a one-to-one mapping between any a(n) = k and some A322469(m) = 6*k - 2.
There is a hierarchy of such permutations of the positive integers derived by mapping the terms of the form 6*k - 2 to k:
Level 1: A322469
Level 2: A307048 (this sequence)
Level 3: A160016 = 2, 1, 4, 6, 8, 3, ... period of (3 even, 1 odd number)
Level 4: A000027 = 1, 2, 3, 4 ... (the positive integers)
Level 5: A000027

Examples

			Table U(i, j) begins:
   i\j   1  2  3  4  5  6  7
   -------------------------
   1:
   4:          2
   7:                   1
  10:
  13:          6
  16:                5
  19:
  22:         10
  25:             4
  28:
  31:         14
-----
T(4, 3) = 10 = 6*2 - 2, therefore U(4, 3) = 2.
T(7, 6) =  4 = 6*1 - 2, therefore U(7, 6) = 1.
		

Crossrefs

Programs

  • Perl
    # Derived from A322469
    use integer; my $n = 1; my $i = 1; my $an;
    while ($i <= 1000) { # next row
      $an = 4 * $i - 1; &term();
      while ($an % 3 == 0) {
        $an /= 3; &term();
        $an *= 2; &term();
      } # while divisible by 3
      $i ++;
    } # while next row
    sub term {
      if (($an + 2) % 6 == 0) {
        my $bn = ($an + 2) / 6;
        print "$n $bn\n"; $n ++;
      }
    }

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.

Original entry on oeis.org

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

Views

Author

Georg Fischer, Dec 09 2018

Keywords

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)
f = A066443(floor(j / 4)) with A066443(n) = (3^(2*n+1)+1)/4
g = 2^floor((j + 3) / 2)
m = 2^floor((j - 1) / 4) * A084101(j + 1 mod 4) with A084101(0..3) = (1, 3, 3, 1)
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).
Length of row n = 1, 2, ... is 1+2*A007949(A004767(n-1)). - M. F. Hasler, Dec 10 2018
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 1: A322469 (this sequence), inverse is A338208
Level 2: A307048, inverse is A338207
Level 3: A160016, inverse is A338206
Level >= 4: A000027, the positive integers
Conjectures (verified for k = 0..11):
a(A338186(k)) = 4^k.
If A338186(k) <= j < A338186(k+1) then a(A338186(k)) <= a(j).
(End)

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
		

Crossrefs

Cf. A066443, A084101, A160016 (level 3), A307048 (level 2), A307407 (level 0), A308709, A338186, A338206, A338207, A338208.

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

A307407 Irregular table read by rows: rows list terms that map to the nodes in the graph of the "3x+1" (or Collatz) problem.

Original entry on oeis.org

16, 4, 5, 1, 10, 2, 3, 40, 12, 13, 64, 20, 21, 88, 28, 29, 9, 58, 112, 36, 37, 136, 44, 45, 160, 52, 53, 17, 106, 34, 35, 11, 70, 22, 23, 7, 46, 14, 15, 184, 60, 61, 208, 68, 69, 232, 76, 77, 25, 154, 50, 51, 256, 84, 85, 280, 92, 93
Offset: 1

Views

Author

Georg Fischer, Apr 14 2019

Keywords

Comments

The construction is similar to that in A322469. The sequence is the flattened form of an irregular table S(i, j) (see the example below) which has rows i >= 1 consisting of subsequences of varying length.
Like Truemper (cf. link), we denote the mapping x -> 2*x by "m" ("multiply"), the mapping x -> (x - 1)/3 by "d" ("divide"), and the combined mapping "dm" x -> (x - 1)/3 * 2 by "s" ("squeeze"). The d mapping is defined only if it is possible, that is, if x - 1 is divisible by 3. We write m, d and s as infix operation words, for example "4 mms 10", and we use exponents for repeated operations, for example "mms^2 = mmss".
Row i in table S is constructed by the following algorithm: Start with 6 * i - 2 in column j = 1. The following columns j are defined in groups of four by the operations:
k j=4*k+2 j=4*k+3 j=4*k+4 j=4*k+5
--------------------------------------------------
0 mm dmm mmd dmmd
1 mms dmms mmsd dmmsd
2 mms^2 dmms^2 mms^2d dmms^2d
...
k mms^k dmms^k mm(s^k)d dmm(s^k)d
The construction for the row terminates at the first column where a d operation is no longer possible. This point is always reached. This can be proved by the observation that, for any row i in S, there is a unique mapping x -> (x + 2)/6 of the terms in column 1, 2, 5, 9, 13, ... 4*m+1 to the terms in row i of table T in A322469. The row construction process in A322469 stops, therefore it stops also in the sequence defined here.
Conjecture: The sequence is a permutation of the positive numbers.

Examples

			Table S(i, j) begins:
  i\j    1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ----------------------------------------------------------------
  1:    16   4   5   1  10   2   3
  2:    40  12  13
  3:    64  20  21
  4:    88  28  29   9  58
  5:   112  36  37
  6:   136  44  45
  7:   160  52  53  17 106  34  35  11  70  22  23   7  46  14  15
  8:   184  60  61
		

Crossrefs

Cf. A160016 (level 3), A307048 (level 2), A322469 (level 1).

Programs

  • Perl
    cf. link.

A338208 Inverse permutation to A322469.

Original entry on oeis.org

2, 3, 1, 16, 7, 14, 4, 17, 12, 8, 5, 15, 21, 33, 6, 126, 26, 13, 9, 69, 31, 50, 10, 124, 38, 22, 11, 34, 43, 67, 18, 127, 48, 27, 19, 122, 55, 86, 20, 70, 60, 32, 23, 51, 65, 103, 24, 125, 74, 39, 25, 179, 79, 120, 28, 287, 84, 44, 29, 68, 91, 143, 30, 1100, 96, 49, 35, 232, 101, 160, 36, 123, 108, 56, 37, 87, 113, 177, 40, 611
Offset: 1

Views

Author

Georg Fischer, Oct 16 2020

Keywords

Comments

Permutation of the positive integers.
There is a hierarchy of such permutations derived by selecting and mapping the terms of the form 6*k - 2 to k:
Level 0: A307407
Level 1: A322469, inverse is A338208 (this sequence)
Level 2: A307048 A338207
Level 3: A160016 A338206
Level 4: A000027 (the positive integers)

Crossrefs

A160079 Lodumo_3 of Fibonacci numbers.

Original entry on oeis.org

0, 1, 4, 2, 3, 5, 8, 7, 6, 10, 13, 11, 9, 14, 17, 16, 12, 19, 22, 20, 15, 23, 26, 25, 18, 28, 31, 29, 21, 32, 35, 34, 24, 37, 40, 38, 27, 41, 44, 43, 30, 46, 49, 47, 33, 50, 53, 52, 36, 55, 58, 56, 39, 59, 62, 61, 42, 64, 67, 65, 45, 68, 71, 70, 48, 73, 76, 74, 51, 77, 80, 79, 54
Offset: 0

Views

Author

Philippe Deléham, May 01 2009

Keywords

Comments

Permutation of nonnegative integers.

Crossrefs

Cf. A000045, A082115, A160016, A160051, A367651 (inverse permutation).

Formula

a(n) = lod_3(A000045(n)).
a(n) = 2*a(n-8) - a(n-16) for n >= 16. - Philippe Deléham, Mar 09 2023
a(8*n) = 6*n, a(8*n+1) = 9*n+1, a(8*n+2) = 9*n+4, a(8*n+3) = 9*n+2, a(8*n+4) = 6*n+3, a(8*n+5) = 9*n+5, a(8*n+6) = 9*n+8, a(8*n+7) = 9*n+7. - Philippe Deléham, Nov 24 2023
From Philippe Deléham, Nov 29 2023 : (Start)
a(n) = a(n-4) + a(n-8) - a(n-12) for n >= 12.
G.f. : (x + 4*x^2 + 2*x^3 + 3*x^4 + 4*x^5 + 4*x^6 + 5*x^7 + 3*x^8 + 4*x^9 + x^10 + 2*x^11) / (1 - x^4 - x^8 + x^12). (End)
Showing 1-6 of 6 results.