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.

A238324 a(1) = 1 and a(n+1) = if a(n) > 2*n+1 then a(n)-2*n-1 else a(n)+2*n+1.

This page as a plain text file.
%I A238324 #34 Oct 07 2016 14:39:13
%S A238324 1,4,9,2,11,22,9,24,7,26,5,28,3,30,1,32,65,30,67,28,69,26,71,24,73,22,
%T A238324 75,20,77,18,79,16,81,14,83,12,85,10,87,8,89,6,91,4,93,2,95,190,93,
%U A238324 192,91,194,89,196,87,198,85,200,83,202,81,204,79,206,77
%N A238324 a(1) = 1 and a(n+1) = if a(n) > 2*n+1 then a(n)-2*n-1 else a(n)+2*n+1.
%C A238324 Abs(a(n+1) - a(n)) = 2*n+1;
%C A238324 a(A265327(n)) = n and a(m) != n for m < A265327(n).
%H A238324 Reinhard Zumkeller, <a href="/A238324/b238324.txt">Table of n, a(n) for n = 1..10000</a>
%t A238324 nxt[{n_,a_}]:={n+1,If[a>2n+1,a-2n-1,a+2n+1]}; NestList[nxt,{1,1},70][[All,2]] (* _Harvey P. Dale_, Oct 07 2016 *)
%o A238324 (Haskell)
%o A238324 a238324 n = a238324_list !! (n-1)
%o A238324 a238324_list = scanl1 (\u v -> if u > v then u - v else u + v) [1, 3 ..]
%Y A238324 Cf. A005408, A046901, A265327.
%K A238324 nonn
%O A238324 1,2
%A A238324 _Reinhard Zumkeller_, Dec 07 2015