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.

A357144 Square array, A(n, k), n, k >= 0, read by antidiagonals; A(n, k) = g(f(n) * f(k)) where f(m) = A002487(m)/A002487(m+1) and g is the inverse of f.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 8, 3, 0, 0, 4, 1, 1, 4, 0, 0, 5, 32, 15, 32, 5, 0, 0, 6, 14, 6, 6, 14, 6, 0, 0, 7, 4, 7, 256, 7, 4, 7, 0, 0, 8, 5, 9, 2, 2, 9, 5, 8, 0, 0, 9, 128, 63, 48, 35, 48, 63, 128, 9, 0, 0, 10, 6, 2, 1, 1, 1, 1, 2, 6, 10, 0, 0, 11, 56, 27, 2048, 47, 60, 47, 2048, 27, 56, 11, 0
Offset: 0

Views

Author

Rémy Sigrist, Sep 15 2022

Keywords

Comments

The function f is a bijection from the nonnegative integers to the nonnegative rational numbers.
The positive integers, together with (x,y) -> A(x,y), form an abelian group isomorph to the multiplicative group of positive rational numbers (f and g act as isomorphisms).
Each row (or column), except the first, is a permutation of the nonnegative integers.

Examples

			Array A(n, k) begins:
  n\k | 0   1    2   3     4     5    6    7      8    9    10   11    12
  ----+------------------------------------------------------------------
    0 | 0   0    0   0     0     0    0    0      0    0     0    0     0
    1 | 0   1    2   3     4     5    6    7      8    9    10   11    12
    2 | 0   2    8   1    32    14    4    5    128    6    56   17    16
    3 | 0   3    1  15     6     7    9   63      2   27    33   31    30
    4 | 0   4   32   6   256     2   48    1   2048   60    16   62   384
    5 | 0   5   14   7     2    35    1   47     20    3  1022  119    10
    6 | 0   6    4   9    48     1   60    3     32  510    12   13    72
    7 | 0   7    5  63     1    47    3  511     14   15    61  383    33
    8 | 0   8  128   2  2048    20   32   14  32768    4   320   26   512
    9 | 0   9    6  27    60     3  510   15      4   93    30   39   258
   10 | 0  10   56  33    16  1022   12   61    320   30   196    5  1008
   11 | 0  11   17  31    62   119   13  383     26   39     5  575     1
   12 | 0  12   16  30   384    10   72   33    512  258  1008    1   960
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, 1) = n.
A(n, A054429(n)) = 1 for any n > 0.
A(m, A(n, k)) = A(A(m, n), k).
A(n, A(n-1, ... A(2, 1) ... )) = 2^(A002487(n+1)-1).

A358110 Indices of the harmonic numbers in the Stern-Brocot sequence (A002487).

Original entry on oeis.org

0, 1, 5, 125, 8195, 32675, 755, 34763, 520283, 37773179, 21743337467, 4647489635464983347207, 1236947931143, 272658152711, 604398345569737906323527, 9595849053479089263878087, 3693713292455, 288389531265129191, 11150032316898390632304469945009811031588839
Offset: 0

Views

Author

Peter Luschny, Nov 08 2022

Keywords

Comments

We assume the harmonic numbers to start with H(0) = 0.

Examples

			Let Fusc(n) = fusc(n) / fusc(n + 1) where fusc = A002487.
          0 = H(0) = Fusc(0)      => a(0) = 0.
          1 = H(1) = Fusc(1)      => a(1) = 1.
      (3/2) = H(2) = Fusc(5)      => a(2) = 5.
     (11/6) = H(3) = Fusc(125)    => a(3) = 125.
    (25/12) = H(4) = Fusc(8195)   => a(4) = 8195.
   (137/60) = H(5) = Fusc(32675)  => a(5) = 32676.
    (49/20) = H(6) = Fusc(755)    => a(6) = 755.
  (363/140) = H(7) = Fusc(34763)  => a(7) = 34763.
  (761/280) = H(8) = Fusc(520283) => a(8) = 520283.
		

References

  • Edsger W. Dijkstra, Selected Writings on Computing, Springer, 1982, p. 232 (sequence A002487 is called fusc).

Crossrefs

Cf. A002487, A001008/A002805 (harmonic), A355090.

Programs

  • PARI
    a(n) = { my (h=sum(i=1, n, 1/i), x=numerator(h), y=denominator(h)); if (x==0, 0, my (v=0, t=1, a=0, b=1, c=1, d=0); while (1, my (m=a+c, n=b+d); if (x*n==y*m, return (t+v), x*nRémy Sigrist, Nov 08 2022
    
  • Python
    # using function harmonic from A001008
    def A358110(n: int) -> int:
        if n == 0: return 0
        x, y = harmonic(1, n + 1)
        a = d = v = 0
        b = c = t = 1
        while True:
            m = a + c
            n = b + d
            if x * n == y * m:
                return v + t
            if x * n < y * m:
                c, d = m, n
            else:
                v, a, b = v + t, m, n
            t *= 2
    print([A358110(n) for n in range(19)]) # (after Rémy Sigrist) Peter Luschny, Nov 08 2022

Formula

a(n) = A355090(A001008(n), A002805(n)) for any n > 0. - Rémy Sigrist, Nov 08 2022

Extensions

More terms from Rémy Sigrist, Nov 08 2022
Showing 1-2 of 2 results.