login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182973 Denominators of positive rationals < 1 arranged by increasing sum of numerator and denominator then by increasing numerator. 13
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
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
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.
LINKS
Paul Yiu, Recreational Mathematics, 24.3.1 Appendix: Two enumerations of the rational numbers in (0,1), page 633.
EXAMPLE
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).
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 *)
PROG
(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.
(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
(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
CROSSREFS
Cf. A182972 (numerators), A366191 (interleaved).
Sequence in context: A286448 A325277 A257573 * A360565 A278056 A366880
KEYWORD
nonn,easy,frac,nice
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:59 EDT 2024. Contains 371963 sequences. (Running on oeis4.)