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.

A066199 a(1) = 1; for n > 1, a(n) = a(n-1)-(n+1) if this is positive and has not already appeared in the sequence, otherwise a(n) = a(n-1)+(n+1).

This page as a plain text file.
%I A066199 #24 May 08 2021 23:05:05
%S A066199 1,4,8,3,9,2,10,19,29,18,6,19,5,20,36,53,35,16,36,15,37,14,38,13,39,
%T A066199 12,40,11,41,72,104,71,105,70,34,71,33,72,32,73,31,74,30,75,121,168,
%U A066199 120,169,119,68,120,67,121,66,122,65,7,66,126,187,125,62,126,61,127,60,128
%N A066199 a(1) = 1; for n > 1, a(n) = a(n-1)-(n+1) if this is positive and has not already appeared in the sequence, otherwise a(n) = a(n-1)+(n+1).
%H A066199 Indranil Ghosh, <a href="/A066199/b066199.txt">Table of n, a(n) for n = 1..10000</a>
%H A066199 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%o A066199 (Python)
%o A066199 l=[0, 1]
%o A066199 for n in range(2, 101):
%o A066199     x=l[n - 1] - (n + 1)
%o A066199     if x>0 and x not in l: l.append(x)
%o A066199     else: l.append(l[n - 1] + (n + 1))
%o A066199 print(l[1:]) # _Indranil Ghosh_, Jun 02 2017
%Y A066199 A variant of A005132. A row of the array in A066201.
%K A066199 nonn,easy
%O A066199 1,2
%A A066199 _N. J. A. Sloane_, Dec 16 2001
%E A066199 More terms from _Sascha Kurz_, Mar 24 2002