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.

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

This page as a plain text file.
%I A187922 #25 May 06 2020 11:21:33
%S A187922 6,7,9,18,19,21,33,34,36,66,67,69,71,73,75,101,102,104,106,108,113,
%T A187922 114,115,117,121,123,125,127,133,134,172,173,175,177,179,181,183,186,
%U A187922 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
%N A187922 Positions k of addition steps in Recamán's sequence where A005132(k-1)-k = A005132(m) for some 0 < m < k.
%C A187922 Subsequence of A057165; A005132(a(n)-1) - a(n) = A005132(A187943(n));
%C A187922 A005132(a(n)) = A005132(a(n)-1) + a(n);
%C A187922 See A187921 for the other positions of addition steps in A005132.
%H A187922 Rémy Sigrist, <a href="/A187922/b187922.txt">Table of n, a(n) for n = 1..25000</a>
%H A187922 Rémy Sigrist, <a href="/A187922/a187922.txt">C++ program for A187943</a>
%H A187922 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%e A187922 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.
%o A187922 (Haskell)
%o A187922 import Data.Set (Set, singleton, member, insert)
%o A187922 a187922 n = a187922_list !! (n-1)
%o A187922 a187922_list = r (singleton 0) 1 0 where
%o A187922    r :: Set Integer -> Integer -> Integer -> [Integer]
%o A187922    r s n x | x <= n           = r (insert (x+n) s) (n+1) (x+n)
%o A187922            | (x-n) `member` s = n : r (insert (x+n) s) (n+1) (x+n)
%o A187922            | otherwise        = r (insert (x-n) s) (n+1) (x-n)
%o A187922 (C++) See Links section.
%Y A187922 Cf. A005132, A057165, A187921, A187943, A333548, A333552.
%K A187922 nonn
%O A187922 1,1
%A A187922 _Reinhard Zumkeller_, Mar 17 2011
%E A187922 Added condition "0 < m" to definition. See A333552. - _N. J. A. Sloane_, May 04 2020