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

A258252 Sequence of distinct positive integers having lowest possible denominators of sums of 1/a(n).

Original entry on oeis.org

1, 2, 6, 3, 4, 12, 15, 10, 14, 35, 5, 30, 42, 7, 8, 24, 18, 9, 33, 88, 40, 60, 84, 63, 99, 22, 26, 143, 11, 154, 238, 51, 21, 28, 20, 55, 66, 78, 91, 56, 72, 90, 110, 132, 156, 13
Offset: 1

Views

Author

Ivan Neretin, May 24 2015

Keywords

Comments

a(n) is chosen among the unused positive integers so that the denominator of Sum_{i=1..n} 1/a(i), is as low as possible.
Presumably a permutation of positive integers.
Primes do not always occur in natural order.
The numbers which retain their natural positions (that is, a(n)=n) are 1, 2, 48, 80601...
Inverse (A258253): 1, 2, 4, 5, 11, 3, 14, 15, 18, 8, 29, 6, 46, 9, 7, 47, 73, 17, 134, 35, 33, 26, 153, 16, 96, ..., . - Robert G. Wilson v, Jun 18 2015
Records: 1, 2, 6, 12, 15, 35, 42, 88, 99, 143, 154, 238, 260, 460, 544, 840, 1645, 1666, 2109, 2622, 3876, 4599, 5644, 6565, 6734, 8701, 9492, 10272, ..., . - Robert G. Wilson v, Jun 18 2015

Examples

			After 2 terms, the partial sum of 1/a(i) reaches 3/2. Adding 1 or 1/2 is impossible, since 1 and 2 are already taken. The rest of positive integers lead to the following sums: +1/3 -> 11/6, +1/4 -> 7/4, +1/5 -> 17/10, +1/6 -> 5/3 with denominator 3 which is the lowest we can get. Hence a(3)=6.
For this specific term, the fractions that are encountered are 3/2 + 1/k with k>2. The resulting sequence of denominators are: 6, 4, 10, 3, 14, 8, 18, 5, 22, 12, ... (see A145979) within which the smallest term is indeed 3. - _Michel Marcus_, Jun 04 2015
		

Crossrefs

Cf. A157248 (another reordering of the harmonic series), A258253 (putative inverse), A258254 (denominators of partial sums of 1/a(n)), A258255 (positions where partial sums reach integers).

Programs

  • Mathematica
    f[lst_] := Block[{c = 0, d, dk, k, mk, mn = Infinity, t = Total[1/lst]}, d = Denominator@ t; k = d; While[c < 101, If[ !MemberQ[lst, k], c++; dk = Denominator[t + 1/k]; If[dk < mn, mn = dk; mk = k]]; k += d]; Append[lst, mk]]; Nest[f, {}, 60] (* Robert G. Wilson v, Jun 18 2015 *)

A375802 Lexicographically earliest sequence of positive integers such that the sum of the inverses of the indices where the sequence has the same value is at most 1.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 29 2024

Keywords

Comments

In other words, if a(n_1) = ... = a(n_k) with n_1 < ... < n_k then 1/n_1 + ... + 1/n_k <= 1.
Each positive integer appears in the sequence, a finite number of times. This is a consequence of the fact that the greedy algorithm for Egyptian fractions terminates in a finite number of steps for any rational starting value.

Examples

			The first terms, alongside the sums of the inverses of the indices so far where the sequence has the same value, are:
  n   a(n)  Sums
  --  ----  ---------
   1     1  1
   2     2  1/2
   3     2  5/6
   4     3  1/4
   5     3  9/20
   6     2  1
   7     3  83/140
   8     3  201/280
   9     3  2089/2520
  10     3  2341/2520
		

Crossrefs

Programs

  • PARI
    { b = vector(6); for (n = 1, 87, for (v = 1, oo, if (b[v] + 1/n <= 1, b[v] += 1/n; print1 (v", "); break;););); }
    
  • Python
    from fractions import Fraction
    from itertools import count, islice
    from collections import defaultdict
    def agen(): # generator of terms
        invsum, mink = defaultdict(int), 1
        for n in count(1):
            an = next(k for k in count(mink) if invsum[k] + Fraction(1, n) <= 1)
            yield an
            invsum[an] += Fraction(1, n)
            while invsum[mink] == 1: mink += 1
    print(list(islice(agen(), 87))) # Michael S. Branicky, Aug 31 2024

Formula

a(A157248(n)) <= a(A157248(n+1)).
Showing 1-2 of 2 results.