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 11-20 of 21 results. Next

A064294 Term at which last number of height n occurs in Recamán's sequence A005132.

Original entry on oeis.org

1, 4, 5, 16, 31, 64, 131, 222, 403, 770, 1409, 2652, 4825, 9078, 16773, 30768, 56827, 99734, 181653, 328002, 588583, 1032996, 1787013, 3220128, 5771203, 10201340, 18394609, 32144188, 58055311, 101762018, 173367175, 302844912, 511518279, 904032692
Offset: 1

Views

Author

N. J. A. Sloane, Sep 26 2001

Keywords

Comments

The height of a term in A005132 = number of addition steps - number of subtraction steps to produce it.

Crossrefs

Cf. A005132, A064290, A064292, A064293. This sequence and A064492 keep pretty close together.

A057166 Indices of subtraction steps in Recamán's sequence A005132.

Original entry on oeis.org

4, 8, 10, 12, 14, 16, 20, 22, 23, 25, 27, 29, 31, 35, 37, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 68, 70, 72, 74, 76, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 103, 105, 107, 109, 110, 111, 116, 118, 119, 120, 122, 124, 126, 128
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2000

Keywords

Crossrefs

A245340 Smallest m such that A125717(m) = n, or -1 if n never appears.

Original entry on oeis.org

0, 1, 4, 2, 8, 21, 3, 5, 18, 16, 14, 12, 10, 6, 1518, 32, 58, 30, 184, 28, 7, 26, 9, 11, 13, 15, 17, 19, 102, 51, 100, 49, 98, 47, 96, 45, 94, 43, 92, 41, 90, 39, 88, 37, 86, 35, 84, 20, 24, 22, 505, 81, 2510, 79, 166, 77, 296, 75, 501, 73, 162, 71, 498, 69
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 21 2014

Keywords

Comments

Conjecture: a(n) is never -1.

Crossrefs

For RECORDS see A370956 and A370959.

Programs

  • Haskell
    import Data.IntMap (singleton, member, (!), insert)
    a245340 n = a245340_list !! n
    a245340_list = 0 : f [1..] [1..] 0 (singleton 0 0) where
       f us'@(u:us) vs'@(v:vs) w m
         | u `member` m = (m ! u) : f us vs' w m
         | otherwise    = g (reverse[w-v,w-2*v..1] ++ [w+v,w+2*v..]) where
         g (x:xs) = if x `member` m then g xs else f us' vs x $ insert x v m
    
  • Python
    from itertools import count
    def A245340(n):
        a, aset = 0, set()
        for m in count(1):
            if a==n: return m-1
            aset.add(a)
            a = next(a for a in count(a%m,m) if a not in aset) # Chai Wah Wu, Mar 13 2024

A078758 Term in A064389 (variation (4) of Recamán's sequence) where n appears, or 0 if n never appears.

Original entry on oeis.org

1, 4, 2, 35, 33, 3, 5, 16, 14, 12, 10, 8, 6, 188, 58, 186, 184, 23, 25, 7, 9, 11, 13, 15, 17, 182, 48, 46, 50, 1774, 1770, 1772, 1786, 1784, 1766, 40, 1764, 32, 34, 36, 22, 20, 18, 24, 26, 204, 202, 200, 198, 196, 194, 192, 190, 1758, 1762, 1760, 79, 77, 1782, 602
Offset: 1

Views

Author

Reiner Martin, Jan 08 2003

Keywords

Comments

Is it ever 0?
If all a(n)>0, then this is the inverse permutation of A064389. - M. F. Hasler, Nov 03 2014
After 10^12 terms of A064389, the first unknown term of this sequence is 5191516. - Benjamin Chaffin, Oct 09 2016

Crossrefs

Programs

  • PARI
    for(i=1,9e9,for(j=1,#a064389,a064389[j]==i&&print1(j",")+next(2));break) \\ The terms of A064389 must be stored in the vector a064389. - M. F. Hasler, Nov 03 2014

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))

A335300 a(n) is the least k such that A335299(k) = n, or -1 if no such k exists.

Original entry on oeis.org

0, 1, 4, 2, 71, 73, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 438, 7, 9, 11, 13, 15, 17, 59, 57, 520, 410, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 692, 22, 20, 18, 28, 30, 32, 97, 424, 234, 96, 94, 92, 90, 88, 86, 240, 4518, 296, 294, 464, 462, 19, 21
Offset: 0

Views

Author

Rémy Sigrist, May 31 2020

Keywords

Crossrefs

A118202 Inverse of A118201, or -1 if n does not occur in A118201.

Original entry on oeis.org

0, 1, 4, 2, 1715, 31, 3, 5, 16, 14, 12, 10, 8, 6, 476, 101, 99, 97, 23, 303, 7, 9, 11, 13, 15, 17, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 683, 681, 22, 20, 18, 24, 77, 699, 697, 703, 695, 693, 691, 689, 687, 1723, 1725, 1721, 267, 269, 2686, 67, 263, 19, 21
Offset: 0

Views

Author

Keywords

Comments

Conjecture that a(n) is never -1.

Crossrefs

A293273 a(n) is the smallest positive k <> n such that f(k) is divisible by f(n) where f = A005132, or 0 if no such k exists.

Original entry on oeis.org

2, 3, 8, 3, 9, 35, 43, 15, 20, 11, 28, 7, 32, 21, 83, 15, 69, 26, 152, 24, 116, 47, 44, 20, 48, 18, 43, 59, 30, 63, 20, 104, 41, 71, 39, 75, 72, 35, 35, 36, 33, 79, 92, 83, 96, 87, 100, 91, 245, 95, 239, 67, 276, 19, 119, 63, 109, 57, 103, 51, 185, 45, 139, 35, 145, 86, 415, 84, 192, 82, 184, 80, 180, 78, 176
Offset: 1

Views

Author

Altug Alkan, Oct 10 2017

Keywords

Comments

Conjecture: a(n) > 0 for all n.

Examples

			a(6) = 35 because A005132(35) = 78 is divisible by A005132(6) = 13 and 78 is the smallest positive number which is not equal to 6 with this property.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # to use A005132(n) for n = 1..N
    S:= {0}:
    A5132:= Array(0..N):
    A5132[0]:= 0:
    for n from 1 to N do
      v:= A5132[n-1]-n;
      if v < 0 or member(v,S) then v:= A5132[n-1]+n fi;
      A5132[n]:= v;
      S:= S union {v};
    od:
    f:= proc(n) local k;
      for k from 1 to N do
        if k <> n and A5132[k] mod A5132[n] = 0 then return k fi
      od:
    0
    end proc:
    Res:= NULL:
    for n from 1 do
      v:= f(n);
      if v = 0 then break fi;
      Res:= Res,v;
    od:
    Res; # Robert Israel, Oct 10 2017

A072349 a(n) = m such that A064388(m) = n, or 0 if no such m exists.

Original entry on oeis.org

1, 4, 2, 934, 932, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 236, 7, 9, 11, 13, 15, 17, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40
Offset: 1

Views

Author

David Wasserman, Jul 17 2002

Keywords

Comments

Next term, a(39), is either 0 or greater than 400000. My guess is that this sequence is not computable, i.e., there is some n that does not occur in A064388, but it is impossible to prove this.

Crossrefs

Cf. A057167.

A355646 Term in Recamán's sequence A005132 where n appears for the last time, or -1 if n never appears.

Original entry on oeis.org

0, 1, 4, 2, 131, 129, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 99734, 7, 9, 11, 13, 15, 17, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 111, 22, 24, 26, 28, 30, 32, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, 181653
Offset: 0

Views

Author

Iain Fox, Jul 11 2022

Keywords

Comments

Same sequence as A057167 until a(42) = 24.
Let k be the largest member of A057167 before A057167(n). Trivially, if A057167(n) > k, a(n) = A057167(n).
If every nonnegative integer appears in A005132, then -1 does not appear in this sequence.

Crossrefs

Previous Showing 11-20 of 21 results. Next