login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A187921
Positions k of addition steps in Recamán's sequence where A005132(k-1)<=k.
6
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,2
EXAMPLE
a(10)=26: A005132(26-1) = 17 and 17-26<0, hence A005132(26) = 17+26 = 43.
PROG
(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)
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.
Sequence in context: A269004 A379316 A100475 * A275059 A072538 A225856
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 17 2011
STATUS
approved