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.

A309216 a(0)=0; thereafter a(n) = a(n-1)+n if the (n-1)st digit of the sequence is even, otherwise a(n) = a(n-1)-n.

This page as a plain text file.
%I A309216 #12 Aug 10 2019 15:54:29
%S A309216 0,1,-1,-4,0,5,-1,-8,0,9,-1,-12,-24,-11,3,18,2,-15,-33,-52,-32,-11,
%T A309216 -33,-56,-80,-105,-131,-104,-132,-103,-133,-164,-196,-229,-263,-228,
%U A309216 -192,-155,-193,-154,-194,-235,-277,-320,-364,-319,-273,-320,-368,-319,-369,-318,-370,-423,-477,-532
%N A309216 a(0)=0; thereafter a(n) = a(n-1)+n if the (n-1)st digit of the sequence is even, otherwise a(n) = a(n-1)-n.
%C A309216 The absolute values of the digits are 0, 1, 1, 4, 0, 5, 1, 8, 0, 9, 1, 1, 2, 2, 4, 1, 1, 3, 1, 8, 2, 1, 5, 3, 3, 5, 2, ... (Of course the signs can be ignored when looking at the parity of the digits.)
%H A309216 N. J. A. Sloane, <a href="/A309216/b309216.txt">Table of n, a(n) for n = 0..10000</a>
%p A309216 t:=0;
%p A309216 a:=[0]; b:=[]; M:=100;
%p A309216 for i from 1 to M do
%p A309216 v1:=convert(abs(t),base,10); L:=nops(v1);
%p A309216 v2:=[seq(v1[L-i+1],i=1..L)];
%p A309216 b:=[op(b),op(v2)];
%p A309216 if (b[i] mod 2) = 0 then t:=t+i else t:=t-i; fi;
%p A309216 a:=[op(a),t];
%p A309216 od:
%p A309216 a;
%Y A309216 Cf. A003816, A309529, A309214, A309215, A309217.
%K A309216 sign,base
%O A309216 0,4
%A A309216 _N. J. A. Sloane_, Aug 10 2019