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

A182973 Denominators of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator.

Original entry on oeis.org

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

Views

Author

William Rex Marshall, Dec 16 2010

Keywords

Comments

A023022(n) and A245678(n) give number and denominator of sum of fractions A182972(k)/a(k) such that A182972(k) + a(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, ...
(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. A182972 (numerators), A366191 (interleaved).

Programs

  • Haskell
    a182973 n = a182973_list !! (n-1)
    a182973_list = map snd $ 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
    
  • Mathematica
    A182973list[s_] := Table[If[CoprimeQ[num, s-num], s-num, Nothing], {num, Floor[s/2]}]; Flatten[Array[A182973list, 25, 3]] (* Paolo Xausa, Feb 27 2024 *)
  • Pascal
    program a182973;
    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,' ',den);
      until n=100000;
    end.
    
  • Python
    from itertools import count, islice
    from math import gcd
    def A182973_gen(): # generator of terms
        return (n-i for n in count(2) for i in range(1,1+(n-1>>1)) if gcd(i,n-i)==1)
    A182973_list = list(islice(A182973_gen(),10)) # Chai Wah Wu, Aug 28 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 *)

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

Original entry on oeis.org

0, 1, 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
Offset: 1

Views

Author

Wolfdieter Lang, Jun 26 2020

Keywords

Comments

The length of row n is A023022(n), for n >= 1, with A023022(1) = 1.
See the Brändli-Beyne link for this mod* system.
This reduced residue system mod* n will be called RRS*(n). The mod* n system is defined only for numbers coprime to n. The definition of mod*(a, n), for gcd(a, n) = 1, is mod(a, n) from RRS(n) given in A038566, if mod(a, n) <= floor(n/2) and mod(-a, n) from RRS(n) otherwise. E.g., mod*(17, 10) = mod(-17, 10) = 3 because mod(17, 10) = 7 > 10/2 = 5. mod*(22, 10) is not defined because gcd(22, 10) = 2, not 1.
Compare this table with the one for the reduced residue system modulo n (called RRS(n)) from A038566. For n >= 3 RRS*(n) consists of the first half of the RRS(n) members.
Each member j of RRS*(n) stands for a reduced representative class [j]* which is given by the union of the ordinary reduced representative classes [j] and [n-j] modulo n, for n >= 3, with j from the first half of the set RRS(n) given in row n of A038566 (but with 0 for n = 1). For n = 1: [0]* = [0] (using A038566(1) = 0, not 1), representing all integers. For n = 2: [1]* = [1], representing all odd integers.
E.g., RRS*(5) = {1, 2} (always considered ordered), and [1]* = {pm1, pm4, pm5, pm9, ...} (pm for + or -), and [2]* = {pm2, pm3, pm7, pm8, ...}. Hence RRS*(5) represents the same integers as RRS(5), but has only 2, not 4 elements (RRS*(5) is not equal to RRS(5)).
The modular arithmetic is multiplicative but not additive for mod* n. This is based on the fact that gcd(a*b, n) = 1 if gcd(a, n) = 1 = gcd(b, n) (not valid in general for gcd(a + b, n)). E.g., 2 = mod*(92, 9) = mod*(23*4, 9) = mod*(4*4, 10) = 2, because 2 <= 4, 5 > 4, 4 <= 4, 7 > 4, hence mod*(23, 9) = mod(-23, 9) = 4, mod*(4, 9) = 4 and mod*(16, 9) = mod(-16, 9) = 2. For n = 9 the class [2]* consists of [2] union [9-2], i.e, {pm2, pm7, pm11, pm16, ...}.

Examples

			The irregular triangle T(n, k) begins:
n\k  1 2 3 4 5 6 7 8 9 ...
-----------------------------------------
1:   0
2:   1
3:   1
4:   1
5:   1 2
6:   1
7:   1 2 3
8:   1 3
9:   1 2 4
10:  1 3
11:  1 2 3 4 5
12:  1 5
13:  1 2 3 4 5 6
14:  1 3 5
15:  1 2 4 7
16:  1 3 5 7
17:  1 2 3 4 5 6 7 8
18:  1 5 7
19:  1 2 3 4 5 6 7 8 9
20:  1 3 7 9
...
-----------------------------------------
n = 9: 1 represents the union of the ordinary restricted residue classes [1] and [-1] = [8], called [1]*, 2 represents the union of [2] and [-2] = [7], called [2]*, and 4 represents the union of [4] and [-4] = [5], called [4]*. One could replace [1]* by [8]*, [2]* by [7]* and [4]* by [5]*, but here the smallest numbers 1, 2, 4 are used for RRS*(9).
Multiplication table for RRS*(9) (x is used here instead of *): 1 x 1 = 1, 1 x 2 = 2, 1 x 4 = 4; 2 x 1 = 2, 2 x 2 = 4, 2 x 4 = 1; 4 x 1 = 4, 4 x 2 = 1, 4 x 4 = 2. This is the (Abelian) cyclic group C_3.
		

Crossrefs

Cf. A023022, A038566 (RRS), A333857.
Essentially the same as A182972.

Programs

  • PARI
    RRS(n) = select(x->gcd(n, x)==1, [1..n]); \\ A038566
    row(n) = if (n<=2, [n-1], my(r=RRS(n)); Vec(r, #r/2)); \\ Michel Marcus, Sep 17 2023

Formula

T(1, 1) = 0, T(2, 1) = 1, and T(n, k) = A038566(n, k) for k = 1, 2, ..., A023022(n), for n >= 3.

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.
Previous Showing 11-14 of 14 results.