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.

A088230 a(1)=0; for n>1: a(n)=a(n-1)-n if that number is nonnegative and occurs at most once in the sequence, otherwise a(n)=a(n-1)+n.

This page as a plain text file.
%I A088230 #15 Apr 04 2014 01:56:31
%S A088230 0,1,3,0,4,9,3,10,2,11,1,12,24,11,25,10,26,9,27,8,28,7,29,6,30,5,31,4,
%T A088230 32,61,31,62,30,63,29,64,28,65,27,66,26,67,25,68,24,69,23,70,22,71,21,
%U A088230 72,20,73,19,74,18,75,17,76,16,77,15,78,14,79,13,80,12,81,151,80,8,81
%N A088230 a(1)=0; for n>1: a(n)=a(n-1)-n if that number is nonnegative and occurs at most once in the sequence, otherwise a(n)=a(n-1)+n.
%H A088230 Reinhard Zumkeller, <a href="/A088230/b088230.txt">Table of n, a(n) for n = 1..10000</a>
%H A088230 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>.
%o A088230 (Haskell)
%o A088230 a088230 n = a088230_list !! (n-1)
%o A088230 a088230_list = 0 : f [1..] [0] where
%o A088230    f (x:xs) ys@(y:_)
%o A088230     | x <= y && (length $ filter (== z) ys) <= 1 = z : f xs (z : ys)
%o A088230     | otherwise = (x + y) : f xs ((x + y) : ys)  where z = y - x
%o A088230 -- _Reinhard Zumkeller_, May 08 2012
%Y A088230 Cf. A005132, A008344.
%K A088230 nonn
%O A088230 1,3
%A A088230 _Reinhard Zumkeller_, Nov 03 2003