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.

Previous Showing 11-17 of 17 results.

A183209 Tree generated by floor(3n/2): a(1) = 1, a(2n) = (3*a(n))-1, a(2n+1) = floor((3*a(n+1))/2).

Original entry on oeis.org

1, 2, 3, 5, 4, 8, 7, 14, 6, 11, 12, 23, 10, 20, 21, 41, 9, 17, 16, 32, 18, 35, 34, 68, 15, 29, 30, 59, 31, 62, 61, 122, 13, 26, 25, 50, 24, 47, 48, 95, 27, 53, 52, 104, 51, 101, 102, 203, 22, 44, 43, 86, 45, 89, 88, 176, 46, 92, 93, 185, 91, 182, 183, 365, 19, 38, 39, 77, 37
Offset: 1

Views

Author

Clark Kimberling, Dec 30 2010

Keywords

Comments

A permutation of the positive integers. See the comment at A183079. Leftmost branch of tree is essentially A061418. Rightmost: A007051.

Examples

			First levels of the tree:
                      1
                      2
            3                   5
          4   8               7   14
		

Crossrefs

Similar permutations: A048673, A254103.
Inverse permutation: A259431.

Programs

  • Haskell
    import Data.List (transpose)
    a183209 n k = a183209_tabf !! (n-1) !! (k-1)
    a183209_row n = a183209_tabf !! (n-1)
    a183209_tabf = [1] : iterate (\xs -> concat $
       transpose [map a032766 xs, map (a016789 . subtract 1) xs]) [2]
    a183209_list = concat a183209_tabf
    -- Reinhard Zumkeller, Jun 27 2015
    
  • Maple
    f:= proc(n) option remember;
      if n::even then 3*procname(n/2)-1
      else floor(3*procname((n+1)/2)/2)
      fi
    end proc:
    f(1):= 1:
    seq(f(n), n=1..100); # Robert Israel, Jan 26 2015
  • Mathematica
    a[1]=1; a[n_] := a[n] = If[EvenQ[n], 3a[n/2]-1, Floor[3a[(n+1)/2]/2] ]; Array[a, 100] (* Jean-François Alcover, Feb 02 2018 *)
  • Python
    def a(n):
        if n==1: return 1
        if n%2==0: return 3*a(n//2) - 1
        else: return (3*a((n - 1)//2 + 1))//2
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017

Formula

Let L(n)=floor(3n/2).
Let U(n)=3n-1. U is the complement of L.
The tree-array T(n,k) is then given by rows:
T(0,0)=1; T(1,0)=2;
T(n,2j)=L(T(n-1),j);
T(n,2j+1)=U(T(n-1),j);
for j=0,1,...,2^(n-1)-1, n>=2.
From Antti Karttunen, Jan 26 2015: (Start)
a(1) = 1, a(2n) = (3*a(n))-1, a(2n+1) = A032766(a(n+1)) = floor((3*a(n+1))/2).
Other identities:
a(2^n) = A007051(n) for all n >= 0. [A property shared with A048673 and A254103.]
(End)

Extensions

Formula to the name-field added by Antti Karttunen, Jan 26 2015

A191449 Dispersion of (3,6,9,12,15,...), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 9, 6, 4, 27, 18, 12, 5, 81, 54, 36, 15, 7, 243, 162, 108, 45, 21, 8, 729, 486, 324, 135, 63, 24, 10, 2187, 1458, 972, 405, 189, 72, 30, 11, 6561, 4374, 2916, 1215, 567, 216, 90, 33, 13, 19683, 13122, 8748, 3645, 1701, 648, 270, 99, 39, 14, 59049
Offset: 1

Views

Author

Clark Kimberling, Jun 05 2011

Keywords

Comments

Transpose of A141396.
Background discussion: Suppose that s is an increasing sequence of positive integers, that the complement t of s is infinite, and that t(1)=1. The dispersion of s is the array D whose n-th row is (t(n), s(t(n)), s(s(t(n))), s(s(s(t(n)))), ...). Every positive integer occurs exactly once in D, so that, as a sequence, D is a permutation of the positive integers. The sequence u given by u(n)=(number of the row of D that contains n) is a fractal sequence. Examples:
(1) s=A000040 (the primes), D=A114537, u=A114538.
(2) s=A022343 (without initial 0), D=A035513 (Wythoff array), u=A003603.
(3) s=A007067, D=A035506 (Stolarsky array), u=A133299.
More recent examples of dispersions: A191426-A191455.

Examples

			Northwest corner:
  1...3....9....27...81
  2...6....18...54...162
  4...12...36...108..324
  5...15...45...135..405
  7...21...63...189..567
		

Crossrefs

A054582: dispersion of (2,4,6,8,...).
A191450: dispersion of (2,5,8,11,...).
A191451: dispersion of (4,7,10,13,...).
A191452: dispersion of (4,8,12,16,...).

Programs

  • Mathematica
    (* Program generates the dispersion array T of increasing sequence f[n] *)
    r=40; r1=12; c=40; c1=12;
    f[n_] :=3n (* complement of column 1 *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]]
    (* A191449 array *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191449 sequence *)
    (* Program by Peter J. C. Moses, Jun 01 2011 *)

Formula

T(i,j)=T(i,1)*T(1,j)=floor((3i-1)/2)*3^(j-1).

A135423 a(n) = (5*9^n + 1)/2.

Original entry on oeis.org

3, 23, 203, 1823, 16403, 147623, 1328603, 11957423, 107616803, 968551223, 8716961003, 78452649023, 706073841203, 6354664570823, 57191981137403, 514727830236623, 4632550472129603, 41692954249166423, 375236588242497803
Offset: 0

Views

Author

Paul Curtz, Feb 18 2008

Keywords

Crossrefs

Bisection of A057198. Cf. A191450.

Programs

  • Magma
    [(5*9^n+1)/2: n in [0..30]]; // Vincenzo Librandi, Nov 08 2011
  • Mathematica
    Table[ (5*9^n + 1)/2, {n,0,25}] (* or *) LinearRecurrence[{10, -9}, {3, 23}, 25] (* G. C. Greubel, Oct 14 2016 *)

Formula

a(n) = 9*a(n-1) - 4 for n>0, a(0)=3.
O.g.f.: (1/(1-x) - 5/(9*x-1))/2. - R. J. Mathar, Feb 19 2008
a(n) = 10*a(n-1) - 9*a(n-2). - Vincenzo Librandi, Nov 08 2011
E.g.f.: (1/2)*( 5*exp(9*x) + exp(x) ). - G. C. Greubel, Oct 14 2016

Extensions

More terms from R. J. Mathar, Feb 19 2008
Definition rewritten (with Mathar's formula) from Bruno Berselli, Nov 08 2011

A191656 Dispersion of (2,4,5,7,8,10,...), by antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 9, 11, 13, 16, 14, 12, 17, 20, 25, 22, 19, 15, 26, 31, 38, 34, 29, 23, 18, 40, 47, 58, 52, 44, 35, 28, 21, 61, 71, 88, 79, 67, 53, 43, 32, 24, 92, 107, 133, 119, 101, 80, 65, 49, 37, 27, 139, 161, 200, 179, 152, 121, 98, 74, 56
Offset: 1

Views

Author

Clark Kimberling, Jun 10 2011

Keywords

Comments

Row 1: A006999.
For a background discussion of dispersions, see A191426.
...
Each of the sequences (3n, n>0), (3n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191449=dispersion of A008583 (0 mod 3)
A191451=dispersion of A016777 (1 mod 3)
A191450=dispersion of A016789 (2 mod 3)
A191656=dispersion of A001651 (1 or 2 mod 3)
A083044=dispersion of A007494 (0 or 2 mod 3)
A191655=dispersion of A032766 (0 or 1 mod 3)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191449 has 1st col A001651, all else A008583
A191451 has 1st col A007494, all else A016777
A191450 has 1st col A032766, all else A016789
A191656 has 1st col A008583, all else A001651
A083044 has 1st col A016777, all else A083044
A191655 has 1st col A016789, all else A032766
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.

Examples

			Northwest corner:
1...2....4....7....11
3...5....8....13...20
6...10...16...25...38
9...14...22...34...52
12..19...29...44...67
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 2; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 3*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A001651: (2+5k,4+5k, k>=0) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i,1,10}, {j,1,10}]]          (* A191656 array *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]]   (* A191656 sequence *)

A340245 Order array of the Wythoff B-array (A340244): an interspersion, read by antidiagonals.

Original entry on oeis.org

1, 2, 4, 3, 7, 5, 6, 11, 9, 8, 10, 19, 15, 14, 12, 17, 31, 26, 23, 20, 13, 28, 51, 43, 39, 32, 22, 16, 46, 81, 71, 64, 53, 36, 27, 18, 75, 110, 101, 94, 83, 60, 44, 30, 21, 105, 138, 130, 123, 112, 90, 73, 49, 35, 24, 133, 165, 157, 151, 140, 119, 103, 79
Offset: 1

Views

Author

Clark Kimberling, Jan 02 2021

Keywords

Comments

Suppose that (r(n,k)), for n >= 1 and k >= 1 is an array of distinct numbers. Replace each r(n,k) with its position when all the numbers r(n,k) are ordered by <. The resulting array is the order array of (r(n,k)). The order array A340245 is an interspersion and a dispersion, and, as a sequence, a permutation of the natural numbers; see A333029 and A191450.

Examples

			Corner:
   1    2    3    6   10    17    28    46
   4    7   11   19   31    51    81   110
   5    9   15   26   43    71   101   130
   8   14   23   39   64    94   123   151
  12   20   32   53   83   112   140   167
		

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; f[n_] := Fibonacci[n];
    a[n_] := Floor[r*n]; b[n_] := Floor[r^2*n];
    c[n_] := a[a[b[n]]]; d[n_] := b[a[b[n]]];
    w[n_, k_] := f[k - 2] c[n] + f[k - 1] d[n];
    Grid[Table[w[n, k], {n, 1, 9}, {k, 1, 15}]] (* A340244 array *)
    u = Table[w[n - k + 1, k], {n, 30}, {k, n, 1, -1}]//Flatten  (* A340244 sequence *)
    rk[n_] := Position[Sort[u], u[[n]]];
    Take[Flatten[Table[rk[n], {n, 1, 350}]], 100]  (* A340245 sequence *)

A257943 Array A read by upward antidiagonals in which the entry in row n and column k is defined by A(n,k) = (1 + 3^(n-1)*(2*k - 1))/2, n,k >= 1.

Original entry on oeis.org

1, 2, 2, 5, 5, 3, 14, 14, 8, 4, 41, 41, 23, 11, 5, 122, 122, 68, 32, 14, 6, 365, 365, 203, 95, 41, 17, 7, 1094, 1094, 608, 284, 122, 50, 20, 8, 3281, 3281, 1823, 851, 365, 149, 59, 23, 9, 9842, 9842, 5468, 2552, 1094, 446, 176, 68, 26, 10
Offset: 1

Views

Author

L. Edson Jeffery, May 13 2015

Keywords

Examples

			Array A begins:
.     1      2      3      4      5       6       7       8       9      10
.     2      5      8     11     14      17      20      23      26      29
.     5     14     23     32     41      50      59      68      77      86
.    14     41     68     95    122     149     176     203     230     257
.    41    122    203    284    365     446     527     608     689     770
.   122    365    608    851   1094    1337    1580    1823    2066    2309
.   365   1094   1823   2552   3281    4010    4739    5468    6197    6926
.  1094   3281   5468   7655   9842   12029   14216   16403   18590   20777
.  3281   9842  16403  22964  29525   36086   42647   49208   55769   62330
.  9842  29525  49208  68891  88574  108257  127940  147623  167306  186989
		

Crossrefs

Programs

  • Mathematica
    (* Array: *)
    Grid[Table[(1 + 3^(n - 1)*(2*k - 1))/2, {n, 10}, {k, 10}]]
    (* Array antidiagonals flattened: *)
    Flatten[Table[(1 + 3^(n - k)*(2*k - 1))/2, {n, 10}, {k, n}]]

A279724 Transpose of array A257943.

Original entry on oeis.org

1, 2, 2, 3, 5, 5, 4, 8, 14, 14, 5, 11, 23, 41, 41, 6, 14, 32, 68, 122, 122, 7, 17, 41, 95, 203, 365, 365, 8, 20, 50, 122, 284, 608, 1094, 1094, 9, 23, 59, 149, 365, 851, 1823, 3281, 3281, 10, 26, 68, 176, 446, 1094, 2552, 5468, 9842, 9842
Offset: 1

Views

Author

L. Edson Jeffery, Dec 17 2016

Keywords

Examples

			Array A begins as:
.      1   2   5   14   41   122   365   1094   3281    9842
.      2   5  14   41  122   365  1094   3281   9842   29525
.      3   8  23   68  203   608  1823   5468  16403   49208
.      4  11  32   95  284   851  2552   7655  22964   68891
.      5  14  41  122  365  1094  3281   9842  29525   88574
.      6  17  50  149  446  1337  4010  12029  36086  108257
.      7  20  59  176  527  1580  4739  14216  42647  127940
.      8  23  68  203  608  1823  5468  16403  49208  147623
.      9  26  77  230  689  2066  6197  18590  55769  167306
.     10  29  86  257  770  2309  6926  20777  62330  186989
		

Crossrefs

Programs

  • Mathematica
    (* Array: *)
    Grid[Table[(1 + 3^(k - 1)*(2*n - 1))/2, {n, 10}, {k, 10}]]
    (* Array antidiagonals flattened (gives this sequence): *)
    Flatten[Table[(1 + 3^(k - 1)*(2*(n - k) + 1))/2, {n, 10}, {k, n}]]

Formula

A(n,k) = (1 + 3^(k-1)*(2*n - 1))/2, n,k >= 1.
Previous Showing 11-17 of 17 results.