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

A092542 Table whose n-th row is constant and equal to n, read by antidiagonals alternately upwards and downwards.

Original entry on oeis.org

1, 1, 2, 3, 2, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9
Offset: 1

Views

Author

Sam Alexander, Feb 27 2004

Keywords

Comments

Let A be sequence A092542 (this sequence) and B be sequence A092543 (1, 2, 1, 1, 2, 3, 4, ...). Under upper trimming or lower trimming, A transforms into B and B transforms into A. Also, B gives the number of times each element of A appears. For example, A(7) = 1 and B(7) = 4 because the 1 in A(7) is the fourth 1 to appear in A. - Kerry Mitchell, Dec 28 2005
First inverse function (numbers of rows) for pairing function A056023 and second inverse function (numbers of columns) for pairing function A056011. - Boris Putievskiy, Dec 24 2012
The rational numbers a(n)/A092543(n) can be systematically ordered and numbered in this way, as Georg Cantor first proved in 1873. - Martin Renner, Jun 05 2016

Examples

			The table
  1 1 1 1 1 ...
  2 2 2 2 2 ...
  3 3 3 3 3 ...
  4 4 4 4 4 ...
gives
  1;
  1 2;
  3 2 1;
  1 2 3 4;
  5 4 3 2 1;
  1 2 3 4 5 6;
		

References

  • Amir D. Aczel, "The Mystery of the Aleph, Mathematics, the Kabbalah and the Search for Infinity", Barnes & Noble, NY 2000, page 112.

Crossrefs

Variants of Cantor's enumeration are: A352911, A366191, A319571, A354266.

Programs

  • Mathematica
    Table[ Join[Range[2n - 1], Reverse@ Range[2n - 2]], {n, 8}] // Flatten (* Robert G. Wilson v, Sep 28 2006 *)

Formula

a(n) = ((-1)^t+1)*j/2-((-1)^t-1)*i/2, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 24 2012

Extensions

Name edited by Michel Marcus, Dec 14 2023

A209278 Second inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 3, 2, 4, 1, 3, 4, 2, 5, 1, 4, 3, 5, 2, 6, 1, 4, 5, 3, 6, 2, 7, 1, 5, 4, 6, 3, 7, 2, 8, 1, 5, 6, 4, 7, 3, 8, 2, 9, 1, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1
Offset: 1

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
1...2...2...3...3...4...4...5...
1...3...2...4...3...5...4...6...
1...4...2...5...3...6...4...7...
1...5...2...6...3...7...4...8...
1...6...2...7...3...8...4...9...
1...7...2...8...3...9...4..10...
1...8...2...9...3..10...4..11...
. . .
The start of the sequence as triangle array read by rows:
1;
2, 1;
2, 3, 1;
3, 2, 4, 1;
3, 4, 2, 5, 1;
4, 3, 5, 2, 6, 1;
4, 5, 3, 6, 2, 7, 1;
5, 4, 6, 3, 7, 2, 8, 1;
. . .
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2 +1, (r+1)/2 -1, ... 2, r, 1.
If r is even r/2 + 1, r/2, r/2 + 2, ...  2, r, 1.
		

Crossrefs

Programs

  • Mathematica
    T[r_, s_] := If[OddQ[s], (s+1)/2, r + s/2];
    Table[T[r-s+1, s], {r, 1, 11}, {s, r, 1, -1}] // Flatten (* Jean-François Alcover, Nov 19 2019 *)
  • PARI
    T(r,s)=s\2+if(bittest(s,0),1,r) \\ - M. F. Hasler, Jan 15 2013
  • Python
    t=int((math.sqrt(8*n-7) - 1)/ 2)
    i=n-t*(t+1)/2
    result=int((t+3)/2)+int(i/2)*(-1)**(i+t)
    

Formula

a(n) = floor((A003056(n)+3)/2) + floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)).
a(n)= floor((t+3)/2)+ floor(i/2)*(-1)^(i+t),
where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s-1)=s, T(r,2s)= r+s. (When read as square array by antidiagonals.)

A209279 First inverse function (numbers of rows) for pairing function A185180.

Original entry on oeis.org

1, 1, 2, 2, 1, 3, 2, 3, 1, 4, 3, 2, 4, 1, 5, 3, 4, 2, 5, 1, 6, 4, 3, 5, 2, 6, 1, 7, 4, 5, 3, 6, 2, 7, 1, 8, 5, 4, 6, 3, 7, 2, 8, 1, 9, 5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1, 12, 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13
Offset: 1

Views

Author

Boris Putievskiy, Jan 15 2013

Keywords

Comments

The triangle equals A158946 with the first column removed. - Georg Fischer, Jul 26 2023

Examples

			The start of the sequence as table T(r,s) r,s >0 read by antidiagonals:
  1...1...2...2...3...3...4...4...
  2...1...3...2...4...3...5...4...
  3...1...4...2...5...3...6...4...
  4...1...5...2...6...3...7...4...
  5...1...6...2...7...3...8...4...
  6...1...7...2...8...3...9...4...
  7...1...8...2...9...3..10...4...
  ...
The start of the sequence as triangle array read by rows:
  1;
  1, 2;
  2, 1, 3;
  2, 3, 1, 4;
  3, 2, 4, 1, 5;
  3, 4, 2, 5, 1, 6;
  4, 3, 5, 2, 6, 1, 7;
  4, 5, 3, 6, 2, 7, 1, 8;
  ...
Row number r contains permutation numbers form 1 to r.
If r is odd (r+1)/2, (r+1)/2-1, (r+1)/2+1,...r-1, 1, r.
If r is even r/2, r/2+1, r/2-1, ... r-1, 1, r.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := Abs[(2*k - 1 + (-1)^(n - k)*(2*n + 1))/4];
    Table[T[n, k], {n, 1, 15}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 14 2018, after Andrew Howroyd *)
  • PARI
    T(n, k)=abs((2*k-1+(-1)^(n-k)*(2*n+1))/4) \\ Andrew Howroyd, Dec 31 2017
    
  • Python
    # Edited by M. F. Hasler, May 30 2020
    def a(n):
       t = int((math.sqrt(8*n-7) - 1)/2);
       i = n-t*(t+1)/2;
       return int(t/2)+1+int(i/2)*(-1)**(i+t+1)

Formula

a(n) = floor((A003056(n)+2)/2)+ floor(A002260(n)/2)*(-1)^(A002260(n)+A003056(n)+1).
a(n) = |A128180(n)|.
a(n) = floor((t+2)/2) + floor(i/2)*(-1)^(i+t+1), where t=floor((-1+sqrt(8*n-7))/2), i=n-t*(t+1)/2.
T(r,2s)=s, T(r,2s-1)= r+s-1.(When read as table T(r,s) by antidiagonals.)
T(n,k) = ceiling((n + (-1)^(n-k)*k)/2) = (n+k)/2 if n-k even, otherwise (n-k+1)/2. - M. F. Hasler, May 30 2020

Extensions

Data corrected by Andrew Howroyd, Dec 31 2017

A322392 Array A read by antidiagonals: A(n,k) = n-th digit of the base k expansion of 1/n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 4, 2, 5, 1, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 5, 3, 2, 1, 1, 0, 3, 3, 0, 0, 0, 0, 1, 0, 1, 3, 0, 0, 2, 1, 0, 3, 0, 0, 0, 6, 0, 8, 0, 4, 1, 6, 0
Offset: 1

Views

Author

Derek J. Graves, Dec 06 2018, on behalf of Joseph A. Stocke

Keywords

Examples

			A(10,9) = 8, as the 10th digit of the base 9 expansion of 1/10 = 0.0808080808080808080808080808... is 8.
Array A(n, k) begins:
n\k  1    2    3    4    5    6    7    8    9   10
1    0    0    0    0    0    0    0    0    0    0
2    0    0    1    0    2    0    3    0    4    0
3    0    0    0    1    1    0    2    2    0    3
4    0    0    2    0    1    0    5    0    2    0
5    0    0    0    0    0    1    1    1    1    0
6    0    0    1    2    4    0    1    2    4    6
7    0    0    0    0    0    0    0    1    1    1
8    0    0    1    0    3    0    6    0    1    0
9    0    0    0    3    3    0    3    0    0    1
10   0    0    0    1    2    3    4    6    8    0
		

Crossrefs

Supersequence of A061480.

Programs

  • Mathematica
    a = {}; l = 100; x = Table[ Join[Range[2n - 1], Reverse@ Range[2n - 2]], {n, l}] // Flatten; y = Table[ Join[Range[2m], Reverse@Range[2m - 1]], {m, l-1}] // Flatten; Do[a = Append[a, Mod[ Floor[1/Part[x, i] * Part[y,i]^Part[x, i]], Part[y,i]] ], {i, 1, l} ]; a

A354459 Lazy cutter's sequence (see Comments).

Original entry on oeis.org

2, 3, 4, 4, 5, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23
Offset: 1

Views

Author

Ivan N. Ianakiev, May 31 2022

Keywords

Comments

From the infinite sequence G of fractions that may be used to demonstrate the countability of rational numbers, where a(n) = A092542(n)/A092543(n), form a new sequence H by taking only those terms of G that are proper fractions unequal to a fraction that appears earlier in H (making H the list of all proper fractions without repetitions). Let b/c be the n-th term of H and b be the number of congruent pizzas that have to be equally divided between c people by means of radial cuts. a(n) is the minimum number of cuts to achieve such a division.
H can be directly calculated as its n-th term equals A182972(n)/A182973(n). H starts with 1/2, 1/3, 1/4, 2/3, 1/5, 1/6, 2/5, 3/4, 3/5, 1/7, 1/8, 2/7, 4/5, 3/7, 1/9.
As a(n) is equal for all proper fractions b/c such that b + c = n, counting the number of equal consecutive terms of this sequence gives A023022 from its third term onwards (see Geoffrey Critzer's and Reinhard Zumkeller's comments at A023022).

Examples

			To equally divide 4 pizzas between 7 people we can divide each pizza into 7 equal parts with 7 radial cuts making the total number of cuts 28 (far from minimal). Ancient Egyptians, representing 4/7 as 1/2 + 1/14, would cut all pizzas into halves (8 cuts) and one of the halves into 7 equal pieces (6 additional cuts), making the total number of cuts 8 + 6 = 14. We can do even better by cutting each pizza into two pieces (3/7 and 4/7), for a total of 8 cuts, and dividing one 3/7 piece to 3 equal pieces (2 additional cuts), minimizing the total number of cuts to 8 + 2 = 10. Since the 19th term of H sequence is 4/7, a(19) = 10.
		

Crossrefs

Programs

  • Mathematica
    a092542=Flatten[Table[Join[Range[2n-1],Reverse@Range[2n-2]],{n,12}]];
    a092543=Take[Cases[Import["https://oeis.org/A092543/b092543.txt","Table"],{,}][[All,2]],276];g=a092542/a092543; h=DeleteDuplicates[Select[g,#<1&]];
    a[n_]:=Module[{x=Floor[Denominator[n]/Numerator[n]],r=Mod[Denominator[n],
    Numerator[n]]},(x+1)*Numerator[n]+r-1];a/@h

Formula

h(n) = A182972(n)/A182973(n) = b/c, c = x*b + r and a(n) = (x+1)*b + r - 1.
Showing 1-5 of 5 results.