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.

A249036 a(1)=1, a(2)=2; thereafter a(n) = a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).

This page as a plain text file.
%I A249036 #6 May 07 2016 11:46:04
%S A249036 1,2,2,3,4,4,5,5,6,7,8,8,9,9,10,10,11,11,12,13,14,15,16,16,17,17,18,
%T A249036 18,19,19,20,20,21,21,22,22,23,23,24,25,26,27,28,29,30,31,32,32,33,33,
%U A249036 34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47
%N A249036 a(1)=1, a(2)=2; thereafter a(n) = a(n-1-(number of even terms so far)) + a(n-1-(number of odd terms so far)).
%C A249036 Suggested by A006336 and A007604.
%H A249036 Ivan Neretin, <a href="/A249036/b249036.txt">Table of n, a(n) for n = 1..10000</a>
%p A249036 M:=100;
%p A249036 v[1]:=1; v[2]:=2; w[1]:=0; w[2]:=1; x[1]:=1; x[2]:=1;
%p A249036 for n from 3 to M do
%p A249036    v[n]:=v[n-1-w[n-1]]+v[n-1-x[n-1]];
%p A249036 if v[n] mod 2 = 0 then w[n]:=w[n-1]+1; x[n]:=x[n-1];
%p A249036                   else w[n]:=w[n-1]; x[n]:=x[n-1]+1; fi;
%p A249036 od:
%p A249036 [seq(v[n], n=1..M)]; # A249036
%p A249036 [seq(w[n], n=1..M)]; # A249037
%p A249036 [seq(x[n], n=1..M)]; # A249038
%t A249036 Nest[Append[#, #[[Length@Select[#, OddQ]]] + #[[Length@Select[#, EvenQ]]]] &, {1, 2}, 75] (* _Ivan Neretin_, May 02 2016 *)
%Y A249036 Cf. A006336, A007604.
%Y A249036 A249037 and A249038 give numbers of even and odd terms so far.
%K A249036 nonn
%O A249036 1,2
%A A249036 _N. J. A. Sloane_, Oct 26 2014