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

A157807 Numerators of fractions arranged in "antidiagonal boustrophedon" ordering with equivalent fractions removed: (1/1, 2/1, 1/2, 1/3, 3/1, 4/1, 3/2, 2/3, 1/4, 1/5, 5/1, 6/1, 5/2, ...).

Original entry on oeis.org

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

Views

Author

Ron R. King, Mar 07 2009

Keywords

Crossrefs

Cf. A157813 (denominators), A038566.
With Cantor's ordering: A020652, A020653, A352911.

Programs

  • Maple
    R:= NULL: count:= 0:
    for m from 2 while count < 100 do
      S:= select(t -> igcd(t,m-t)=1, [$1..m-1]);
      count:= count+nops(S);
      if m::even then R:= R, op(S) else R:= R, seq(m-t,t=S) fi;
    od:
    R; # Robert Israel, Oct 09 2023
  • Python
    from math import gcd
    for s in range(2, 100, 2):
      for i in range(1, s):
        if gcd(i, s - i) != 1: continue
        print(i)
      for i in range(s, 0, -1):
        if gcd(i, s + 1 - i) != 1: continue
        print(i)
    # Hiroaki Yamanouchi, Oct 06 2014

Extensions

A-number in cross-reference corrected by R. J. Mathar, Sep 23 2009
a(19)-a(20) corrected and a(58)-a(82) added by Hiroaki Yamanouchi, Oct 06 2014
Name corrected by Andrey Zabolotskiy, Oct 10 2023

A157813 Denominators of fractions arranged in "antidiagonal boustrophedon" ordering with equivalent fractions removed: (1/1, 2/1, 1/2, 1/3, 3/1, 4/1, 3/2, 2/3, 1/4, 1/5, 5/1, 6/1, 5/2, ...).

Original entry on oeis.org

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

Views

Author

Ron R. King, Mar 07 2009

Keywords

Crossrefs

Cf. A157807 (numerators), A038567.
With Cantor's ordering: A020652, A020653, A352911.

Programs

  • Maple
    R:= NULL: count:= 0:
    for m from 2 while count < 100 do
      S:= select(t -> igcd(t,m-t)=1, [$1..m-1]);
      count:= count+nops(S);
      if m::odd then R:= R, op(S) else R:= R, seq(m-t,t=S) fi;
    od:
    R; # Robert Israel, Oct 09 2023
  • Python
    from math import gcd
    for s in range(2, 100, 2):
      for i in range(1, s):
        if gcd(i, s - i) != 1: continue
        print(s - i)
      for i in range(s, 0, -1):
        if gcd(i, s + 1 - i) != 1: continue
        print(s + 1 - i)
    # Hiroaki Yamanouchi, Oct 06 2014

Extensions

a(58)-a(83) from Hiroaki Yamanouchi, Oct 06 2014
Name corrected by Andrey Zabolotskiy, Oct 10 2023

A366191 Enumeration of the rational numbers in the closed real interval [0, 1] after Cantor.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Oct 10 2023

Keywords

Comments

The rational numbers in the interval [0, 1] are listed as pairs of relatively prime integers a(2*n-1) / a(2*n).
Start with (0, 1). Then append pairs (t, n - t) where t and n - t are relatively prime positive integers and 1 <= t <= floor(n/2). Sort first by n then by t in ascending order.

Examples

			Seen as an irregular table:
   1: [0,  1],
   2: [1,  1],
   3: [1,  2],
   4: [1,  3],
   5: [1,  4], [2, 3],
   6: [1,  5],
   7: [1,  6], [2, 5], [3, 4],
   8: [1,  7], [3, 5],
   9: [1,  8], [2, 7], [4, 5],
  10: [1,  9], [3, 7],
  11: [1, 10], [2, 9], [3, 8], [4, 7], [5, 6],
  ...
		

Crossrefs

Cf. A352911, A333856 (numerators only).
Essentially, A182972/A182973 give the numerators/denominators separately.

Programs

  • Maple
    A366191List := proc(upto) local C, F, n, t, count;
    C := [0, 1]; count := 0:
    for n from 2 while count < upto do
        F := select(t -> igcd(t, n - t) = 1, [$1..iquo(n,2)]);
        C := C, seq([t, n - t], t = F);
        count := count + nops(F) od;
    ListTools:-Flatten([C]) end:
    A366191List(40);
  • Mathematica
    A366191row[n_] := If[n == 1, {0, 1}, Select[Array[{#, n - #}&, Floor[n/2]], CoprimeQ[First[#], Last[#]]&]];
    Array[A366191row, 20] (* Paolo Xausa, Jan 16 2024 *)

A366192 Pairs (i, j) of noncoprime positive integers sorted first by i + j then by i.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Oct 10 2023

Keywords

Comments

The rows of A290600 interleaved term by term with the reversed rows of A290600. - Peter Munn, Jan 28 2024

Examples

			The first few pairs are, seen as an irregular triangle (where rows with a prime index are empty (and are therefore missing)):
  [2,  2],
  [2,  4], [3,  3], [4, 2],
  [2,  6], [4,  4], [6, 2],
  [3,  6], [6,  3],
  [2,  8], [4,  6], [5, 5], [6, 4], [ 8, 2],
  [2, 10], [3,  9], [4, 8], [6, 6], [ 8, 4], [ 9, 3], [10, 2],
  [2, 12], [4, 10], [6, 8], [7, 7], [ 8, 6], [10, 4], [12, 2],
  [3, 12], [5, 10], [6, 9], [9, 6], [10, 5], [12, 3],
  ...
There are A016035(n) pairs in row n.
		

Crossrefs

Cf. A016035, A290600 (first bisection), A352911 (complement).

Programs

  • Maple
    aList := proc(upto) local F, P, n, t, count;
    P := NULL; count := 0:
    for n from 2 while count < upto do
        F := select(t -> igcd(t, n - t) <> 1, [$1..n-1]);
        P := P, seq([t, n - t], t = F);
        count := count + nops([F]) od:
    ListTools:-Flatten([P]) end:
    aList(16);
  • Mathematica
    A366192row[n_]:=Select[Array[{#,n-#}&,n-1],!CoprimeQ[First[#],Last[#]]&];
    Array[A366192row,20,2] (* Paolo Xausa, Nov 28 2023 *)
  • Python
    from math import gcd
    from itertools import chain, count, islice
    def A366192_gen(): # generator of terms
        return chain.from_iterable((i,n-i) for n in count(2) for i in range(1,n) if gcd(i,n-i)>1)
    A366192_list = list(islice(A366192_gen(),30)) # Chai Wah Wu, Oct 10 2023
Showing 1-5 of 5 results.