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.

A008343 a(1)=1; thereafter a(n+1) = a(n)-n if a(n) >= n otherwise a(n+1) = a(n)+n.

This page as a plain text file.
%I A008343 #24 Jul 09 2021 08:24:23
%S A008343 1,0,2,5,1,6,0,7,15,6,16,5,17,4,18,3,19,2,20,1,21,0,22,45,21,46,20,47,
%T A008343 19,48,18,49,17,50,16,51,15,52,14,53,13,54,12,55,11,56,10,57,9,58,8,
%U A008343 59,7,60,6,61,5,62,4,63,3
%N A008343 a(1)=1; thereafter a(n+1) = a(n)-n if a(n) >= n otherwise a(n+1) = a(n)+n.
%C A008343 For n>0, a(A060816(n))=0. - _Dmitry Kamenetsky_, Feb 14 2017
%H A008343 T. D. Noe, <a href="/A008343/b008343.txt">Table of n, a(n) for n=1..1000</a>
%F A008343 a(n) = (n-1+a(n-1)) mod (2*(n-1)). - _Jon Maiga_, Jul 09 2021
%p A008343 A008343 := proc(n) option remember; if n = 1 then 1 elif A008343(n-1) >= (n-1) then A008343(n-1)-(n-1) else A008343(n-1)+(n-1); fi; end;
%t A008343 nxt[{n_,a_}]:={n+1,If[a>=n,a-n,a+n]}; Transpose[NestList[nxt,{1,1},60]][[2]] (* _Harvey P. Dale_, May 04 2014 *)
%Y A008343 Cf. A008344, A060816.
%K A008343 nonn
%O A008343 1,3
%A A008343 _N. J. A. Sloane_ and _J. H. Conway_
%E A008343 Name edited by _Dmitry Kamenetsky_, Feb 14 2017