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

A182972 Numerators of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator.

Original entry on oeis.org

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

Views

Author

William Rex Marshall, Dec 16 2010

Keywords

Comments

A023022(n) and A245677(n) give number and numerator of sum of fractions a(k)/A182973(k) such that a(k) + A182973(k) = n. - Reinhard Zumkeller, Jul 30 2014

Examples

			Positive fractions < 1 listed by increasing sum of numerator and denominator, and by increasing numerator for equal sums:
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
1/16 2/15 3/14 4/13 5/12 6/11 7/10 8/9
1/17 5/13 7/11
1/18 2/17 3/16 4/15 5/14 6/13 7/12 8/11 9/10
1/19 3/17 7/13 9/11
(this is A182972/A182973).
		

References

  • S. Cook, Problem 511: An Enumeration Problem, Journal of Recreational Mathematics, Vol. 9:2 (1976-77), 137. Solution by the Problem Editor, JRM, Vol. 10:2 (1977-78), 122-123.
  • R. K. Guy, Unsolved Problems in Number Theory (UPINT), Section D11.

Crossrefs

Cf. A182973 (denominators), A366191 (interleaved).
Essentially the same as A333856.

Programs

  • Haskell
    a182972 n = a182972_list !! (n-1)
    a182972_list = map fst $ concatMap q [3..] where
       q x = [(num, den) | num <- [1 .. div x 2],
                           let den = x - num, gcd num den == 1]
    -- Reinhard Zumkeller, Jul 29 2014
    
  • Maple
    t1:=[];
    for n from 2 to 40 do
    t1:=[op(t1),1/(n-1)];
    for i from 2 to floor((n-1)/2) do
       if gcd(i,n-i)=1 then t1:=[op(t1),i/(n-i)]; fi; od:
    od:
    t1;
  • Mathematica
    t1={}; For[n=2, n <= 40, n++, AppendTo[t1, 1/(n-1)]; For[i=2, i <= Floor[(n-1)/2], i++, If[GCD[i, n-i] == 1, AppendTo[t1, i/(n-i)]]]]; t1 // Numerator // Rest (* Jean-François Alcover, Jan 20 2015, translated from Maple *)
  • Pascal
    program a182972;
    var
      num,den,n: longint;
    function gcd(i,j: longint):longint;
    begin
      repeat
        if i>j then i:=i mod j else j:=j mod i;
      until (i=0) or (j=0);
      if i=0 then gcd:=j else gcd:=i;
    end;
    begin
      num:=1; den:=1; n:=0;
      repeat
        repeat
          inc(num); dec(den);
          if num>=den then
          begin
            inc(den,num); num:=1;
          end;
        until gcd(num,den)=1;
        inc(n); writeln(n,' ',num);
      until n=100000;
    end.
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A182972_gen(): # generator of terms
        return (i for n in count(2) for i in range(1,1+(n-1>>1)) if gcd(i,n-i)==1)
    A182972_list = list(islice(A182972_gen(),10)) # Chai Wah Wu, Aug 28 2023

Extensions

Corrected by William Rex Marshall, Aug 12 2013

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 *)

A333857 Positive odd numbers b with an unequal number of odd and even elements of the restricted residue system of the mod* congruence of Brändli and Beyne (numbers b ordered increasingly).

Original entry on oeis.org

1, 21, 33, 57, 63, 69, 77, 93, 99, 129, 133, 141, 147, 161, 171, 177, 189, 201, 207, 209, 213, 217, 231, 237, 249, 253, 279, 297, 301, 309, 321, 329, 341, 363, 381, 387, 393, 399, 413, 417, 423, 437, 441, 453, 469, 473, 483, 489, 497, 501, 513, 517, 531, 537, 539, 553, 567, 573, 581, 589, 597
Offset: 1

Views

Author

Wolfdieter Lang, Jun 26 2020

Keywords

Comments

For the modified congruence modulo n of Brändli and Beyne, called mod* n, see the link. See also the comments in A333856 for this reduced residue system mod* n, called RRS*(n), for n >= 1.
The odd members of RRS*(n) are denoted by RRS*odd(n), similarly, RRS*even(n) are the even elements of RRS*(n). E.g., RRS*odd(5) = {1} and RRS*even(5) = {2}. Therefore the odd number 5 can be called balanced in the reduced mod* system, because #RRS*odd(5) = 1 = #RRS*even(5).
All even numbers are unbalanced because RRS*(2*m) has only odd members, for m >= 1.
b = 1, with RRS*(1) = {0} is unbalanced, and for odd numbers b >= 3 to be balanced one needs integer phi(b)/4 because #RRS*(b) = phi(b)/2 (phi = A000010). The odd integers >= 3 with integer phi(b)/4 are given in A327922. The present sequence gives, for n >= 2, a proper subset of A327922 consisting of odd numbers b with an unequal number of odd and even elements (unbalanced odd b). Therefore, the condition phi(b)/4 integer for odd b is necessary but not sufficient for such odd b in the reduced mod* system.

Crossrefs

Cf. A038566 (RRS(n)), A333856 (RRS*(n)).

Programs

  • PARI
    RRS(n) = select(x->gcd(n, x)==1, [1..n]); \\ A038566
    RRSstar(n) = if (n<=2, [n-1], my(r=RRS(n)); Vec(r, #r/2)); \\ A333856
    isok(k) = if ((k%2) && ((k==1) || denominator(eulerphi(k)/4)==1), my(v=RRSstar(k)); #select(x->((x%2) == 1), v) != #select(x->((x%2) == 0), v)); \\ Michel Marcus, Sep 17 2023

Formula

This sequence gives the increasingly ordered positive odd integers b from A327922 such that the reduced residue system RRS*(b) does not have the same number of odd and even elements, for n >= 1, The odd number b is then called unbalanced.

Extensions

More terms from Michel Marcus, Sep 17 2023

A334428 Irregular triangle read by rows: row n gives the members of the smallest nonnegative reduced residue system in the modified congruence modulo 2*n - 1 by Brändli and Beyne, called mod*(2*n - 1).

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Jun 27 2020

Keywords

Comments

The length of row n is A072451(n) = A055034(2*n-1), for n >= 1.
See the Brändli-Beyne link, and A333856 for the definition and some examples of this mod* system.
This reduced residue system mod* (2*n - 1) will be called RRS*(2*n - 1).
Compare this table with the one for the reduced residue system modulo 2*n - 1 (called RRS(2*n - 1) = A038566(2*n - 1), but with A038566(1) = 0). For n >= 2 RRS*(2*n-1) consists of the first half of the entries of RRS(2*n - 1).
The modular arithmetic is multiplicative but not additive for mod*. See A333856 for examples.

Examples

			The irregular triangle T(n, k) begins (b = 2*n - 1):
n    b \k  1 2 3 4 5  6  7  8  9 10 11 12 13 14 15 16 17 18 ...
---------------------------------------------------------------
1    1:    0
2    3:    1
3    5:    1 2
4    7:    1 2 3
5    9:    1 2 4
6   11:    1 2 3 4 5
7   13:    1 2 3 4 5  6
8   15:    1 2 4 7
9   17:    1 2 3 4 5  6  7  8
10  19:    1 2 3 4 5  6  7  8  9
11  21:    1 2 4 5 8 10
12  23:    1 2 3 4 5  6  7  8  9 10 11
13  25:    1 2 3 4 6  7  8  9 11 12
14  27:    1 2 4 5 7  8 10 11 13
15  29:    1 2 3 4 5  6  7  8  9 10 11 12 13 14
16  31:    1 2 3 4 5  6  7  8  9 10 11 12 13 14 15
17  33:    1 2 4 5 7  8 10 13 14 16
18  35:    1 2 3 4 6  8  9 11 12 13 16 17
19  37:    1 2 3 4 5  6  7  8  9 10 11 12 13 14 15 16 17 18
20  39:    1 2 4 5 7  8 10 11 14 16 17 19
...
-----------------------------------------------------------
For n = 5 (b = 9) see the example in A333856.
		

Crossrefs

Programs

  • Mathematica
    Array[Function[{m, b}, Select[Range[1, m], GCD[#, b] == 1 &] /. {} -> {0}] @@ {# - 1, 2 # - 1} &, 16] // Flatten (* Michael De Vlieger, Jun 27 2020 *)

Formula

T(1, 1) = 0, T(n, k) = A038566(2*n - 1, k) for k = 1, 2, ..., A072451(n), for n >= 2.
Showing 1-4 of 4 results.