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.

A030340 a(n)=(# 1's)-(# 2's) in first n terms of A003137.

This page as a plain text file.
%I A030340 #12 Jul 13 2013 12:01:54
%S A030340 1,0,1,1,2,3,4,3,2,2,1,2,1,0,1,1,1,2,2,3,4,4,3,4,5,5,6,7,8,9,10,9,10,
%T A030340 9,9,10,9,10,11,10,9,8,8,8,7,7,8,7,7,6,5,6,6,5,6,7,6,7,6,5,4,4,3,2,3,
%U A030340 2,1,0,1,1,1,1,2,2,2,3,4,4,4,3,4,4,5,5
%N A030340 a(n)=(# 1's)-(# 2's) in first n terms of A003137.
%C A030340 This sequence is nonnegative: in any group of numbers with the same number of digits, the number with a 1 in a particular position always occurs before the number with a 2 in that position. In fact, 0's only occur on the last digits of (3^N)-1, where N is an integer, not the sequence index - Larry Reeves (larryr(AT)acm.org), Sep 25 2000
%H A030340 Reinhard Zumkeller, <a href="/A030340/b030340.txt">Table of n, a(n) for n = 1..10000</a>
%o A030340 (Haskell)
%o A030340 a030340 n = a030340_list !! (n-1)
%o A030340 a030340_list = scanl1
%o A030340    (\u v -> u + fromEnum (v == 1) - fromEnum (v == 2)) a003137_list
%o A030340 -- _Reinhard Zumkeller_, Feb 21 2013
%Y A030340 Cf. A030339.
%K A030340 nonn,base
%O A030340 1,5
%A A030340 _Clark Kimberling_
%E A030340 More terms from Larry Reeves (larryr(AT)acm.org), Sep 25 2000
%E A030340 Some data corrected by _Reinhard Zumkeller_, Feb 21 2013