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.

A217974 The ZEBRA Sequence.

This page as a plain text file.
%I A217974 #27 Feb 08 2013 04:55:46
%S A217974 26,5,2,18,1,24,1,0,13,6,24,6,0,12,11,24,11,0,6,12,24,12,0,5,18,24,18,
%T A217974 0,7,19,24,19,0,11,17,24,17,0,8,13,24,13,0,9,16,24,16,0,4,15,24,15,0,
%U A217974 12,20,24,20,0,3,12,24,12,0,17,21,24,21,0,5,7,24,7,0,16,19,24,19,0,9,8,24,8,0,10,15,24,15,0,2,14,24,14,0,13,22,24,22,0,1,11,24,11,0,21,23,24,23,0,10,3,24,3,0,13,14,24,14,0,10,11,24,11,0,4,14,24,14,0,7,20,24,20,0,7,17,24,17,0,13,17,24,17,0,4,11,24,11,0
%N A217974 The ZEBRA Sequence.
%C A217974 If a=1, b=2...
%C A217974 Then ZEBRA = 26,5,2,18,1.
%C A217974 Let the 1st, 3rd, 5th, etc. terms of the sequence be "Black" numbers, and the 2nd, 4th, 6th, etc. be "White" numbers.
%C A217974 Using the first 5 terms as a starting point, to calculate the n-th term, one needs to calculate B(n), the n-th black number using B(n) = B(n-1) - B(n-2). If one runs out of Black numbers to calculate, switch over and calculate White numbers, using the formula W(n) = W(n-1) - W(n-2).
%C A217974 There are no negative terms, so if a negative term appears, multiply it by -1.
%C A217974 A pattern begins to appear: in every group of 5 after the first 8 terms, the 5th term = 0, the middle term = 24 and the 2nd term = 4th term.
%F A217974 B(n) = |B(n-1) - B(n-2)|,
%F A217974 W(n) = |W(n-1) - W(n-2)|.
%e A217974 First 5 terms; 26,5,2,18,1
%e A217974 Black numbers = 26,  2,  1
%e A217974 White numbers = 5,  18
%e A217974 To calculate the 6th term, Use the formula B(n) = B(n-1) - B(n-2)
%e A217974 6th term = 2 - 26 = -24. But there are no negative terms, so 6th term = 24
%e A217974 7th term = 2 - 1  = 1
%e A217974 8th term = 1 - 1  = 0
%e A217974 We can no longer calculate Black numbers, so we switch to calculating White numbers.
%e A217974 9th term = 1st White term - 2nd White term = 5 - 18 = -13  => No negative terms
%e A217974 => 9th term = 13
%e A217974 10th term = 18 - 24 = -6 => 6
%e A217974 11th term = 24 - 0 = 24
%K A217974 nonn
%O A217974 1,1
%A A217974 _Brian J. Tyrrell_, Oct 16 2012