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.

A318388 a(1) = 1, a(n) = -floor(e*a(n/2)) if n is even, a(n) = n - a(n-1) if n is odd.

This page as a plain text file.
%I A318388 #13 Sep 05 2018 18:01:58
%S A318388 1,-2,5,6,-1,-13,20,-16,25,3,8,36,-23,-54,69,44,-27,-67,86,-8,29,-21,
%T A318388 44,-97,122,63,-36,147,-118,-187,218,-119,152,74,-39,183,-146,-233,
%U A318388 272,22,19,-78,121,58,-13,-119,166,264,-215,-331,382,-171,224,98,-43,-399,456,321,-262,509,-448,-592,655,324,-259,-413
%N A318388 a(1) = 1, a(n) = -floor(e*a(n/2)) if n is even, a(n) = n - a(n-1) if n is odd.
%H A318388 Altug Alkan, <a href="/A318388/b318388.txt">Table of n, a(n) for n = 1..10752</a>
%t A318388 Nest[Append[#1, If[EvenQ@ #2, -Floor[E #1[[#2/2]] ], #2 - #1[[-1]] ]] & @@ {#, Length@ # + 1} &, {1}, 65] (* _Michael De Vlieger_, Aug 25 2018 *)
%o A318388 (PARI) a(n)=if(n==1, 1, if(n%2==0, -floor(exp(1)*a(n/2)), n-a(n-1)));
%Y A318388 Cf. A001113, A317825.
%K A318388 sign,look
%O A318388 1,2
%A A318388 _Altug Alkan_, Aug 25 2018