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-2 of 2 results.

A370893 Rectangular array, read by antidiagonals: row n consists of the numbers m whose ternary representation has exactly n runs.

Original entry on oeis.org

1, 2, 3, 4, 5, 10, 8, 6, 11, 30, 13, 7, 15, 32, 91, 26, 9, 16, 33, 92, 273, 40, 12, 19, 34, 96, 275, 820, 80, 14, 20, 46, 97, 276, 821, 2460, 121, 17, 21, 47, 100, 277, 825, 2462, 7381, 242, 18, 23, 48, 101, 289, 826, 2463, 7382, 22143
Offset: 1

Views

Author

Clark Kimberling, Mar 13 2024

Keywords

Comments

Every positive integer occurs exactly once.

Examples

			Corner:
     1     2     4     8    13    26    40
     3     5     6     7     9    12    14
    10    11    15    16    19    20    21
    30    32    33    34    46    47    48
    91    92    96    97   100   101   102
   273   275   276   277   289   290   291
   820   821   825   826   829   830   831
  2460  2462  2463  2464  2476  2477  2478
The ternary representation of 12 is 110, which has 2 runs: 11 and 0.
		

Crossrefs

Cf. A007089, A043555 (number of runs).
Cf. A370698 (binary), A370924, A370925.

Programs

  • Mathematica
    a[n_] := a[n] = Select[Range[25000], Length[Split[IntegerDigits[#, 3]]] == n &];
    t[n_, k_] := a[n][[k]];
    Grid[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]] (* array *)
    Table[t[n - k + 1, k], {n, 10}, {k, n, 1, -1}] // Flatten (* sequence *)

A370925 Rectangular array, read by antidiagonals: row n consists of the numbers m whose ternary representation starts with 2 and has exactly n runs.

Original entry on oeis.org

2, 8, 6, 26, 7, 19, 80, 18, 20, 57, 242, 22, 21, 59, 172, 728, 24, 23, 60, 173, 516, 2186, 25, 55, 61, 177, 518, 1549, 6560, 54, 56, 64, 178, 519, 1550, 4647, 19682, 67, 58, 65, 181, 520, 1554, 4649, 13942
Offset: 1

Views

Author

Clark Kimberling, Mar 13 2024

Keywords

Comments

Every positive integer occurs in this array or A370924.

Examples

			Corner:
       2     8    26    80   242   728  2186
       6     7    18    22    24    25    54
      19    20    21    23    55    56    58
      57    59    60    61    64    65    69
     172   173   177   178   181   182   183
     516   518   519   520   532   533   534
    1549  1550  1554  1555  1558  1559  1560
		

Crossrefs

Programs

  • Mathematica
    d[n_] := First[IntegerDigits[n, 3]];
    a[n_] := a[n] = Select[Range[30000],
    d[#] == 2 && Length[Split[IntegerDigits[#, 3]]] == n &];
    t[n_, k_] := a[n][[k]];
    Grid[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]] (* array *)
    Table[t[n - k + 1, k], {n, 10}, {k, n, 1, -1}] // Flatten (* sequence *)
Showing 1-2 of 2 results.