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.

A334951 a(n) is the smallest candidate for the n-th term of Recamán's sequence A005132.

Original entry on oeis.org

0, -1, -1, 0, 2, -3, 1, 6, 12, 3, 11, 0, 10, -3, 9, -6, 8, -9, 7, 24, 42, 21, 41, 18, -6, 17, -9, 16, -12, 15, -15, 14, -18, 13, 45, 78, 42, 77, 39, 0, 38, -3, 37, -6, 36, -9, 35, -12, 34, -15, 33, -18, 32, -21, 31, -24, 30, -27, 29, -30, 28, -33, 27, -36, 26, -39, 25, 90, 156, 87, 155, 84
Offset: 0

Views

Author

Omar E. Pol, May 17 2020

Keywords

Comments

For n > 0 and after A005132(n-1) the algorithm of Recamán's sequence first explores if a(n) is a valid number to be its next term. If a(n) is nonnegative and not already in the sequence A005132 then a(n) is accepted, so A005132(n) = a(n), otherwise a(n) is rejected and A005132(n) = A005132(n-1) + n, not a(n).
For an illustration of initial terms see the diagram in A334950.

Crossrefs

Bisection of A334950.

Formula

a(0) = 0; for n > 0, a(n) = A005132(n-1) - n.

A334950 Pairs (a,b) where "a" is the smallest candidate for the n-th term of Recamán's sequence and "b" is the n-th term of Recamán's sequence (A005132).

Original entry on oeis.org

0, 0, -1, 1, -1, 3, 0, 6, 2, 2, -3, 7, 1, 13, 6, 20, 12, 12, 3, 21, 11, 11, 0, 22, 10, 10, -3, 23, 9, 9, -6, 24, 8, 8, -9, 25, 7, 43, 24, 62, 42, 42, 21, 63, 41, 41, 18, 18, -6, 42, 17, 17, -9, 43, 16, 16, -12, 44, 15, 15, -15, 45, 14, 14, -18, 46, 13, 79, 45, 113, 78, 78, 42, 114, 77, 77, 39, 39, 0, 78
Offset: 0

Views

Author

Omar E. Pol, May 17 2020

Keywords

Comments

For n > 0 and after A005132(n-1) the algorithm of Recamán's sequence first explores if A005132(n-1) - n = A334951(n) is a valid number to be its n-th term. If A334951(n) is nonnegative and not already in Recamán's sequence then it is accepted, so A005132(n) = A334951(n), otherwise A334951(n) is rejected and A005132(n) = A005132(n-1) + n, not A334951(n). This sequence lists the pairs [A334951(n), A005132(n)], with a(0) = 0.

Examples

			Illustration of initial terms:
                                                       23
                                               22       _
                                       21       _      |
                               20       _      | |     |
                                _      | |     | |     |
                               | |     | |     | |     |
                               | |     | |     | |     |
                               | |     | |     | |     |
                               | |     | |     | |     |
                               | |     | |     | |     |
                           13  | |     | |     | |     |
                            _  | | 12  | |     | |     |
                           | | | |_ _  | | 11  | |     |
                           | | |     | | |_ _  | |  10 |
                           | | | 12  | |     | | |_ _  |
                           | | |     | | 11  | |     | |
                        7  | | |     | |     | | 10  | |
                6       _  | | |     | |     | |     | |
                _      | | | |_|     | |     | |     | |
               | |     | | |         | |     | |     | |
            3  | |     | | |  6      | |     | |     | |
            _  | |  2  | | |         |_|     | |     | |
        1  | | | |_ _  | | |                 | |     | |
    0   _  | | |     | | |_|          3      | |     | |
  _ _  | | | |_|  2  | |                     |_|     | |
     |_| |_|         | |  1                          | |
  0           0      | |                      0      | |
     -1  -1          |_|                             |_|
.
                     -3                              -3
.
In the above diagram the numbers that are written below the path are the terms of A334951 (the candidates for A005132). The numbers that are written above the path are the terms of Recamán's sequence A005132. The length of the n-th vertical-line-segment equals the absolute value of A334952(n).
For n = 4, after A005132(4-1) = 6 the algorithm of Recamán's sequence first explores if A334951(4) = 6 - 4 = 2 is a valid number to be its 4th term. We can see that 2 is nonnegative and not already in Recamán's sequence, then it is accepted, so A005132(4) = A334951(4) = 2.
For n = 5, after A005132(5-1) = 2 the algorithm first explores if A334951(5) = 2 - 5 = -3 is a valid number to be its 5th term. We can see that -3 is negative, so -3 is rejected.
For n = 6, after A005132(6-1) = 7 the algorithm first explores if A334951(6) = 7 - 6 = 1 is a valid number to be its 6th term. We can see that 1 is already in Recamán's sequence, so 1 is rejected.
		

Crossrefs

Cf. A334951 and A005132 interleaved.
Cf. A334952 (first differences).

Formula

a(2n) = A334951(n).
a(2n+1) = A005132(n).
Showing 1-2 of 2 results.