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

A057165 Indices of addition steps in Recamán's sequence A005132.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 9, 11, 13, 15, 17, 18, 19, 21, 24, 26, 28, 30, 32, 33, 34, 36, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 73, 75, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 101, 102, 104, 106, 108, 112, 113, 114
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2000

Keywords

Crossrefs

Union of A187921 and A187922.

Programs

  • Haskell
    import Data.Set (Set, singleton, notMember, insert)
    a057165 n = a057165_list !! n
    a057165_list = r (singleton 0) 1 0 where
       r :: Set Integer -> Integer -> Integer -> [Integer]
       r s n x = if x > n && (x - n) `notMember` s
                    then r (insert (x-n) s) (n+1) (x-n)
                    else n : r (insert (x+n) s) (n+1) (x+n)
    -- Reinhard Zumkeller, Mar 17 2011

Extensions

Initial zero added by N. J. A. Sloane, May 01 2020

A187922 Positions k of addition steps in Recamán's sequence where A005132(k-1)-k = A005132(m) for some 0 < m < k.

Original entry on oeis.org

6, 7, 9, 18, 19, 21, 33, 34, 36, 66, 67, 69, 71, 73, 75, 101, 102, 104, 106, 108, 113, 114, 115, 117, 121, 123, 125, 127, 133, 134, 172, 173, 175, 177, 179, 181, 183, 186, 188, 189, 190, 194, 224, 225, 227, 229, 231, 233, 236, 238, 240, 242, 244, 246, 287, 288, 290, 292, 294, 296, 298, 300, 302, 304, 339, 340, 342, 344, 346, 348, 350
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 17 2011

Keywords

Comments

Subsequence of A057165; A005132(a(n)-1) - a(n) = A005132(A187943(n));
A005132(a(n)) = A005132(a(n)-1) + a(n);
See A187921 for the other positions of addition steps in A005132.

Examples

			a(5) = 19: A005132(19-1) = 43 and 43-19>0, but the term 24=43-19 is already in A005132, therefore A005132(19)=43+19=62; A187943(5)=15 and A005132(15)=24.
		

Crossrefs

Programs

  • Haskell
    import Data.Set (Set, singleton, member, insert)
    a187922 n = a187922_list !! (n-1)
    a187922_list = r (singleton 0) 1 0 where
       r :: Set Integer -> Integer -> Integer -> [Integer]
       r s n x | x <= n           = r (insert (x+n) s) (n+1) (x+n)
               | (x-n) `member` s = n : r (insert (x+n) s) (n+1) (x+n)
               | otherwise        = r (insert (x-n) s) (n+1) (x-n)
    (C++) See Links section.

Extensions

Added condition "0 < m" to definition. See A333552. - N. J. A. Sloane, May 04 2020

A333548 Numbers k such that A005132(k-1) = k.

Original entry on oeis.org

3, 11, 39, 248, 844, 2752, 57071, 58056875
Offset: 1

Views

Author

N. J. A. Sloane, May 01 2020

Keywords

Comments

Subtracting 1 from k gives the index of a term A005132(k-1) = k in Recamán's sequence A005132 such that subtracting k would reach 0. This is not permitted, so we must add k instead, obtaining A005132(k) = 2*k.
If A005132(k-1) = k, A005132(k) = 2*k. The converse is not always true. For example, A005132(75) = 228 and A005132(76) = 228 - 76 = 152. - Seiichi Manyama, May 02 2020

Examples

			A005132(10)=11, so 11 is a term (and A005132(11)=22).
		

Crossrefs

Programs

Extensions

a(8) from Chai Wah Wu, May 02 2020

A333552 List of numbers k defined by property that when the Recamán term A005132(k) is being computed, we are unable to subtract k from A005132(k-1) because, although A003132(k-1) >= k, the result of the subtraction, A005132(k-1)-k, is already in A005132.

Original entry on oeis.org

3, 6, 7, 9, 11, 18, 19, 21, 33, 34, 36, 39, 66, 67, 69, 71, 73, 75, 101, 102, 104, 106, 108, 113, 114, 115, 117, 121, 123, 125, 127, 133, 134, 172, 173, 175, 177, 179, 181, 183, 186, 188, 189, 190, 194, 224, 225, 227, 229, 231, 233, 236, 238, 240, 242, 244, 246, 248, 287, 288, 290, 292, 294, 296, 298, 300, 302, 304
Offset: 1

Views

Author

N. J. A. Sloane, May 03 2020

Keywords

Comments

Positions k of addition steps in Recamán's sequence where A005132(k-1)-k = A005132(m) for some 0 <= m < k.
This is A187922 together with the terms in A333548. (The difference between A187922 and the present sequence is explained by the fact that originally A005132 began at 1 rather than 0.)

Examples

			After we have found A005132(6)=13, we attempt to subtract 7 from 13 to get a(7). However, this would give 6, which is a collision, since we already have A005132(3)=6. So 7 gets added to the current sequence.
		

Crossrefs

A334494 Positions k of addition steps in Recamán's sequence A005132 where A005132(k-1)

Original entry on oeis.org

1, 2, 5, 13, 15, 17, 24, 26, 28, 30, 32, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 112, 130, 132, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 250
Offset: 1

Views

Author

N. J. A. Sloane, May 04 2020

Keywords

Comments

This is A187921 with the terms in A333548 removed. (The difference between A187921 and the present sequence is explained by the fact that originally A005132 began at 1 rather than 0.)

Crossrefs

Showing 1-5 of 5 results.