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.

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

This page as a plain text file.
%I A187921 #15 May 01 2020 22:15:34
%S A187921 1,2,3,5,11,13,15,17,24,26,28,30,32,39,41,43,45,47,49,51,53,55,57,59,
%T A187921 61,63,65,78,80,82,84,86,88,90,92,94,96,98,100,112,130,132,137,139,
%U A187921 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
%N A187921 Positions k of addition steps in Recamán's sequence where A005132(k-1)<=k.
%H A187921 Reinhard Zumkeller, <a href="/A187921/b187921.txt">Table of n, a(n) for n = 1..10000</a>
%H A187921 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%e A187921 a(10)=26: A005132(26-1) = 17 and 17-26<0, hence A005132(26) = 17+26 = 43.
%o A187921 (Haskell)
%o A187921 import Data.Set (Set, singleton, member, insert)
%o A187921 a187921 n = a187921_list !! (n-1)
%o A187921 a187921_list = r (singleton 0) 1 0 where
%o A187921    r :: Set Integer -> Integer -> Integer -> [Integer]
%o A187921    r s n x | x <= n           = n : r (insert (x+n) s) (n+1) (x+n)
%o A187921            | (x-n) `member` s = r (insert (x+n) s) (n+1) (x+n)
%o A187921            | otherwise        = r (insert (x-n) s) (n+1) (x-n)
%Y A187921 Subsequence of A057165;
%Y A187921 A005132(a(n)-1) <= a(n); A005132(a(n)) = A005132(a(n)-1) + a(n);
%Y A187921 see A187922 for the other positions of addition steps in A005132.
%K A187921 nonn
%O A187921 1,2
%A A187921 _Reinhard Zumkeller_, Mar 17 2011