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.
%I A003687 #29 Sep 08 2022 08:44:32 %S A003687 1,2,1,-1,-3,-1,-7,-1,-43,-1,-1807,-1,-3263443,-1,-10650056950807,-1, %T A003687 -113423713055421844361000443,-1, %U A003687 -12864938683278671740537145998360961546653259485195807,-1 %N A003687 a(n+1) = a(n)-a(1)a(2)...a(n-1), if n>0. a(0)=1, a(1)=2. %C A003687 a(n) = a(n-1)-a(n-2)^2+a(n-1)*a(n-2), if n>2. - _Michael Somos_, Mar 19 2004 %C A003687 Consider the mapping f(a/b) = (a - b)/(ab). Taking a = 2 b = 1 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the following sequence 2/1,1/2,-1/2,-3/-2,-1/6,... Sequence contains the numerators. - _Amarnath Murthy_, Mar 24 2003 %C A003687 An infinite coprime sequence defined by recursion. - _Michael Somos_, Mar 19 2004 %H A003687 Seiichi Manyama, <a href="/A003687/b003687.txt">Table of n, a(n) for n = 0..27</a> %t A003687 {1}~Join~NestList[{(#1 - #2), #1 #2} & @@ # &, {2, 1}, 17] [[All, 1]] (* _Michael De Vlieger_, Sep 04 2016 *) %o A003687 (PARI) a(n)=local(an); if(n<1,(n==0),an=vector(max(2,n)); an[1]=2; an[2]=1; for(k=3,n,an[k]=an[k-1]-an[k-2]^2+an[k-1]*an[k-2]); an[n]) %o A003687 (Sage) %o A003687 def A003687(): %o A003687 x, y = 2, 1 %o A003687 yield y %o A003687 while true: %o A003687 yield x %o A003687 x, y = x - y, x * y %o A003687 a = A003687(); print([next(a) for i in range(20)]) # _Peter Luschny_, Dec 17 2015 %o A003687 (Magma) I:=[1,2,1]; [n le 3 select I[n] else Self(n-1)-Self(n-2)^2+Self(n-1)*Self(n-2): n in [1..30]]; // _Vincenzo Librandi_, Dec 17 2015 %Y A003687 Cf. A081478. %Y A003687 For n>1, a(2n-1) = -1, a(2n) = -A007018(n-1) - 1. %K A003687 sign,easy %O A003687 0,2 %A A003687 _N. J. A. Sloane_