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 228 results. Next

A160356 First differences of Recamán's sequence A005132.

Original entry on oeis.org

1, 2, 3, -4, 5, 6, 7, -8, 9, -10, 11, -12, 13, -14, 15, -16, 17, 18, 19, -20, 21, -22, -23, 24, -25, 26, -27, 28, -29, 30, -31, 32, 33, 34, -35, 36, -37, -38, 39, -40, 41, -42, 43, -44, 45, -46, 47, -48, 49, -50, 51, -52, 53, -54, 55, -56, 57, -58, 59, -60, 61, -62, 63
Offset: 1

Views

Author

M. F. Hasler, Jun 03 2009

Keywords

Crossrefs

Formula

a(n) = A005132(n)-A005132(n-1) = n*A160357(n).
As a set, A160356 = A057165 union -A057166.

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

A064387 Variation (2) on Recamán's sequence (A005132): to get a(n), we first try to subtract n from a(n-1): a(n) = a(n-1)-n if positive and not already in the sequence; if not then a(n) = a(n-1)+n+i, where i >= 0 is the smallest number such that a(n-1)+n+i has not already appeared.

Original entry on oeis.org

1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 44, 19, 45, 72, 100, 71, 101, 70, 38, 5, 39, 4, 40, 77, 115, 76, 36, 78, 120, 163, 119, 74, 28, 75, 27, 79, 29, 80, 132, 185, 131, 186, 130, 73, 15, 81, 141, 202
Offset: 1

Views

Author

N. J. A. Sloane, Sep 28 2001

Keywords

Comments

Variation (4) (A064389) is the nicest of these variations.
I would also like to get the following sequences: number of steps before n appears (or 0 if n never appears), list of numbers that never appear, height of n (cf. A064288, A064289, A064290), etc.

References

  • Suggested by J. C. Lagarias.

Crossrefs

Cf. A005132, A046901, A064388, A064389. Agrees with A064389 for first 187 terms, then diverges.

Programs

  • Maple
    h := array(1..100000); maxt := 100000; a := array(1..1000); a[1] := 1; h[1] := 1; for nx from 2 to 1000 do t1 := a[nx-1]-nx; if t1>0 and h[t1] <> 1 then a[nx] := t1; if t1 < maxt then h[t1] := 1; fi; else for i from 0 to 1000 do t1 := a[nx-1]+nx+i; if h[t1] <> 1 then a[nx] := t1; if t1 < maxt then h[t1] := 1; fi; break; fi; od; fi; od; evalm(a);

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

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

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 18, 19, 34, 67, 102, 115, 190, 453, 846, 1305, 2066, 4139, 7676, 13511, 23976, 24381, 24398, 24399, 97984, 136629, 196644, 475235, 926170, 1466185, 2817020, 3850823, 8348662, 8466695, 17694894, 36130539, 36130540, 75209333, 138765002, 315446985, 409493528, 409493529
Offset: 0

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

Extensions

a(0)=0 added by N. J. A. Sloane, May 01 2020

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.

A169748 A variation on Recamán's sequence A005132: see Comments for definition.

Original entry on oeis.org

1, 3, 2, 5, 9, 4, 10, 8, 15, 7, 16, 6, 17, 14, 26, 13, 27, 12, 28, 11, 29, 25, 20, 39, 19, 40, 18, 41, 35, 59, 34, 60, 33, 61, 32, 62, 31, 24, 56, 23, 57, 22, 58, 21, 59, 51, 42, 81, 71, 111, 70, 112, 69, 113, 68, 114, 67, 115, 66, 55, 43, 30, 80, 131, 79, 65, 50, 103, 49, 104
Offset: 1

Views

Author

Rodolfo Kurchan, Apr 08 2010

Keywords

Comments

Sequences A169748-A169752 have the same structure. We start with two sequences A and B. Sequence A is taken to be 1,2,3,4,5,6,7,..., while sequence B varies.
Here sequence B is also 1,2,3,4,5,6,7,....
We start with the first term of sequence A (which is 1).
To extend the sequence, we first try to subtract the next term of A from the current term, but that is allowed only if the result is a positive number not already in the sequence.
If that fails, we next try to subtract the next term of B from the current term, but again that is allowed only if the result is a positive number not already in the sequence.
Finally, if that fails, we add the next term of A to the current term (this may produce repeated terms, but that is allowed at this step).

Examples

			Start with 1 from A,
add 2 from A getting 3,
subtract 1 from B getting 2,
add 3 from A getting 5,
add 4 from A getting 9,
subtract 5 from A getting 4,
add 6 from A getting 10,
subtract 2 from B getting 8,
add 7 from A getting 15,
add 9 from A getting 16,
subtract 10 from A getting 6,
add 11 from A getting 17,
subtract 3 from B getting 14,
add 12 from A getting 26,
subtract 13 from A getting 13, ...
		

Crossrefs

Extensions

Extended by D. S. McNeil, May 09 2010

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

A064388 Variation (3) on Recamán's sequence (A005132): set s (the step size) initially equal to 2; to get a(n), we first try to subtract s from a(n-1): a(n) = a(n-1)-s if positive and not already in the sequence, in which case we change s to s+1; if not, a(n) = a(n-1)+s+i, where i >= 0 is the smallest number such that a(n-1)+s+i has not already appeared and now we change s to s+i+1.

Original entry on oeis.org

1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 44, 17, 45, 16, 46, 15, 47, 14, 48, 83, 119, 82, 120, 81, 121, 80, 38, 84, 37, 85, 36, 86, 35, 87, 34, 88, 33, 89, 32, 90, 31, 91, 30, 92, 29, 93, 28, 94, 27, 95, 26, 96, 167, 239, 166, 240
Offset: 1

Views

Author

N. J. A. Sloane, Sep 28 2001

Keywords

Comments

Variation (4) (A064389) is the nicest of these variations.
I would also like to get the following sequences: number of steps before n appears (or 0 if n never appears), list of numbers that never appear, height of n (cf. A064288, A064289, A064290), etc.

Crossrefs

Programs

  • BASIC
    rem Chipmunk BASIC v3.6.4(b8) http://www.nicholson.com/rhn/basic/
    max=1000 : dim a(max)
    s=2 : z=1 : a(z)=1 : print str$(z)+",";
    for n=1 to 200
    x=z-s : if x <= 0 then goto yyy
    if a(x)=0 then a(x)=1 : print str$(x)+","; : s=s+1 : z=x : goto xxx
    yyy: for i=0 to max
    x=z+s+i
    if a(x)=0 then a(x)=1 : print str$(x)+","; : s=s+i+1 : z=x : goto xxx
    next i
    xxx: next n
    print : end
    rem Jeremy Gardiner, Feb 22 2014

Extensions

More terms from David Wasserman, Jul 16 2002

A187921 Positions k of addition steps in Recamán's sequence where A005132(k-1)<=k.

Original entry on oeis.org

1, 2, 3, 5, 11, 13, 15, 17, 24, 26, 28, 30, 32, 39, 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, 248, 250
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 17 2011

Keywords

Examples

			a(10)=26: A005132(26-1) = 17 and 17-26<0, hence A005132(26) = 17+26 = 43.
		

Crossrefs

Subsequence of A057165;
A005132(a(n)-1) <= a(n); A005132(a(n)) = A005132(a(n)-1) + a(n);
see A187922 for the other positions of addition steps in A005132.

Programs

  • Haskell
    import Data.Set (Set, singleton, member, insert)
    a187921 n = a187921_list !! (n-1)
    a187921_list = r (singleton 0) 1 0 where
       r :: Set Integer -> Integer -> Integer -> [Integer]
       r s n x | x <= n           = n : r (insert (x+n) s) (n+1) (x+n)
               | (x-n) `member` s = r (insert (x+n) s) (n+1) (x+n)
               | otherwise        = r (insert (x-n) s) (n+1) (x-n)
Previous Showing 11-20 of 228 results. Next