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 41-50 of 230 results. Next

A261573 A variation of Recamán's sequence A005132: Define a(0) = 0, and for n > 0, a(n) = a(n-1) - (n+2) if positive and not already in the sequence, otherwise a(n) = a(n-1) + (n+2).

Original entry on oeis.org

0, 3, 7, 2, 8, 1, 9, 18, 28, 17, 5, 18, 4, 19, 35, 52, 34, 15, 35, 14, 36, 13, 37, 12, 38, 11, 39, 10, 40, 71, 103, 70, 104, 69, 33, 70, 32, 71, 31, 72, 30, 73, 29, 74, 120, 167, 119, 168, 118, 67, 119, 66, 120, 65, 121, 64, 6, 65, 125, 186, 124, 61, 125, 60, 126, 59, 127, 58, 128, 57
Offset: 0

Views

Author

Freddy Barrera, Aug 24 2015

Keywords

Comments

As in Recamán's sequence, terms are repeated, the first being 18 = a(7) = a(11).
More generally, for k >= 0, a_k(0) = 0, and for n > 0, a_k(n) = a_k(n-1) - (n+k) if positive and not already in the sequence, otherwise a_k(n) = a_k(n-1) + (n+k).
For k = 0, this is Recamán's sequence A005132.

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{a = s[[-1]], len = Length@ s}, Append[s, If[a > len + 1 && ! MemberQ[s, a - len - 2], a - len - 2, a + len + 2]]]; Nest[f, {0}, 70] (* Robert G. Wilson v, Sep 08 2015 *)
  • Python
    def sequence(n, k):
        """For n > 0 and k >= 0, generates the first n terms of the sequence"""
        A, a = {0}, 0
        yield a
        for n in range(1, n + 1):
            a = a - (n + k)
            if a > 0 and a not in A:
                A.add(a)
                yield a
            else:
                a = a + 2 * (n + k)
                A.add(a)
                yield a
    # List of the first 1000 terms of the sequence with k = 2.
    list(sequence(1000, 2))

A269830 Number of terms of height n in Recamán's sequence A005132.

Original entry on oeis.org

1, 2, 2, 6, 11, 22, 34, 61, 115, 220, 397, 681, 1329, 2430, 4561, 8116, 14848, 24878
Offset: 1

Views

Author

Danny Rorabaugh, Mar 05 2016

Keywords

Comments

The height (A064289) of a term in Recamán's sequence (A005132) = number of addition steps - number of subtraction steps to produce it.

Crossrefs

A274648 A variation on Recamán's sequence (A005132): a(n) is the first positive number of the form a(n-1)-n*k, k>0 not already in the sequence; and if no such number exists, then a(n) is the first number of the form a(n-1)+n*k, k>0 not already in the sequence.

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 5, 45, 66, 44, 67, 19, 69, 17, 71, 15, 73, 103, 72, 40, 106, 38, 108, 36, 110, 34, 112, 32, 114, 30, 116, 28, 118, 26, 120, 168, 119, 169, 16, 68, 121, 175, 65, 177, 63, 179, 61, 181, 59, 183
Offset: 0

Views

Author

Max Barrentine, Aug 12 2016

Keywords

Comments

Is this a permutation of the natural numbers?
The inverse is: 0, 1, 4, 2, 164, 19, 3, 5, 16, 14, 12, 10, 8, 6, 8228, 28, 51, 26, 158, 24, 7, 9, 11, 13, 15, 17, 46, 90, ..., . Robert G. Wilson v, Sep 07 2016
After 3.2*10^11 terms, the smallest number which has not appeared is 154. - Benjamin Chaffin, Oct 05 2016

Crossrefs

Cf. A273148 (inverse), A005132, A274647 (another variant).

Programs

  • Mathematica
    f[s_List] := Block[{k = 1, l = s[[-1]], n = Length@ s}, While[ MemberQ[s, l - k*n] && l > k*n, k++]; If[l > k*n, Append[s, l - k*n], k = 1; While[ MemberQ[s, l + k*n], k++]; Append[s, l + k*n]]]; Nest[f, {0}, 60] (* Robert G. Wilson v, Sep 07 2016 *)

A330791 Values of k such that A005132(k) (the k-th number in the Recamán sequence) divides k.

Original entry on oeis.org

1, 4, 16, 58, 624, 1520, 8346, 9317, 31221, 240048, 297624, 778144, 2757880, 4670769, 7654224, 24206384, 54806653, 76521364, 260393208, 846807152, 19488644316, 58671741024, 105968380189, 140689013614, 325374626148, 535755688021, 1404720439053, 3116427665348, 3883018238329, 16166305650060
Offset: 1

Views

Author

Jud McCranie, Jan 23 2020

Keywords

Comments

The intersection of A064568 and this sequence are the values of k such that A005132(k)=k.
No more terms < 6.46*10^13. - James Ewens, Sep 28 2024

Examples

			A005132(4)=2 and 2 divides 4, so 4 is in the sequence.
		

Crossrefs

Extensions

a(26)-a(30) from James Ewens, Sep 28 2024

A331659 Fixed points in the Recamán sequence; k such that A005132(k) = k.

Original entry on oeis.org

0, 1, 1520, 9317, 31221, 325374626148, 535755688021, 1404720439053, 3883018238329, 16166305650060
Offset: 1

Views

Author

Jud McCranie, Jan 23 2020

Keywords

Comments

This is the intersection of A064568 and A330791.
No more terms < 6.46*10^13. - James Ewens, Sep 27 2024

Examples

			A005132(1520) = 1520, so 1520 is in the sequence.
		

Crossrefs

Extensions

a(7)-a(10) from James Ewens, Sep 27 2024

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.

A064284 Number of times n appears in Recamán's sequence A005132.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Sep 24 2001

Keywords

Crossrefs

Cf. A005132.

Extensions

a(0)=1 inserted by Sean A. Irvine, Jun 26 2023

A064569 Quotients A005132(k)/k for k=A064568(n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Oct 16 2001

Keywords

Comments

No more terms < 6.46*10^13. - James Ewens, Sep 27 2024

Examples

			From _Seiichi Manyama_, May 02 2020: (Start)
Let b(n) = A005132(A064568(n)).
   n | A064568(n) |    b(n) | a(n)
-----+------------+---------+------
   1 |          1 |       1 |    1
   2 |          3 |       6 |    2
   3 |         11 |      22 |    2
   4 |         21 |      63 |    3
   5 |         39 |      78 |    2
   6 |         76 |     152 |    2
   7 |        248 |     496 |    2
   8 |        844 |    1688 |    2
   9 |       1520 |    1520 |    1
  10 |       2752 |    5504 |    2
  11 |       9317 |    9317 |    1
  12 |      17223 |   68892 |    4
  13 |      31221 |   31221 |    1
  14 |      57071 |  114142 |    2
  15 |      99741 |  498705 |    5
  16 |     589932 | 1769796 |    3 (End)
		

Crossrefs

Extensions

a(1)=1 inserted by Seiichi Manyama, May 02 2020
a(22)-a(30) added by James Ewens, Sep 27 2024

A065052 Let R(n) = n-th term of Recamán's sequence A005132; write R(n) = q*n + r with 0 <= r < n; sequence gives values of r.

Original entry on oeis.org

0, 1, 0, 2, 2, 1, 6, 4, 3, 1, 0, 10, 10, 9, 9, 8, 8, 7, 5, 2, 0, 19, 18, 18, 17, 17, 16, 16, 15, 15, 14, 14, 13, 11, 8, 6, 3, 1, 0, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32, 32, 31, 31, 30, 30, 29, 29, 28, 28, 27, 27, 26, 26, 25, 23, 20, 18, 15, 13, 10, 8, 5, 3
Offset: 1

Views

Author

Allan Wilks, Nov 06 2001

Keywords

Crossrefs

A123483 Second order Recamán's sequence: a(0) = 0; for n > 0, a(n) = a(n-1) - A005132(n) if that number is positive and not already in the sequence, otherwise a(n-1) + A005132(n).

Original entry on oeis.org

0, 1, 4, 10, 8, 15, 2, 22, 34, 13, 24, 46, 36, 59, 50, 26, 18, 43, 86, 148, 106, 169, 128, 110, 68, 51, 94, 78, 122, 107, 62, 48, 94, 173, 60, 138, 252, 175, 136, 58, 20, 99, 136, 56, 92, 11, 46, 128, 162, 79, 112, 28, 60, 145, 114, 200, 170, 83, 54, 142, 170, 81, 108, 198
Offset: 0

Views

Author

Keywords

Comments

I conjecture that this sequence contains every natural number. (Even though through n=10000, we still haven't seen 3; we are still occasionally seeing small numbers.) This sequence has an interesting graph.
The smallest n such that a(n) = 3, 6, 12 are, respectively, 4729925, 5808155, 2093396. The following numbers less than 100 do not appear in the sequence for n <= 10^7: 7, 17, 19, 21, 23, 25, 27, 29, 35, 39, 41, 44, 45, 57, 61, 65, 67, 70, 71, 73, 77, 87, 91, 95. - Nick Hobson, Feb 18 2007

Crossrefs

Cf. A005132.
Previous Showing 41-50 of 230 results. Next