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.

A051120 Start with 1; at n-th step, write down what is in the sequence so far.

This page as a plain text file.
%I A051120 #18 Jan 27 2014 08:31:46
%S A051120 1,1,1,3,1,1,3,4,1,1,4,2,3,6,1,1,6,2,4,3,3,1,2,8,1,1,8,2,6,3,4,5,3,3,
%T A051120 2,11,1,1,11,2,8,3,6,1,5,4,4,8,3,5,2,13,1,1,13,2,11,4,8,4,6,3,5,6,4,
%U A051120 10,3,7,2,16,1,1,16,2,13,3,11,1,10,5,8,1,7,6,6,4,5,9,4,12,3,9,2,18,1
%N A051120 Start with 1; at n-th step, write down what is in the sequence so far.
%H A051120 Reinhard Zumkeller, <a href="/A051120/b051120.txt">Table of n, a(n) for n = 0..10000</a>
%e A051120 After 1 1 1 3 1, we see "1 3 and 4 1's", so next terms are 1 3 4 1. Then "1 4, 2 3's, 6 1's"; etc.
%t A051120 s={1}; Do[s=Flatten[{s,{Count[s,#],#}&/@Reverse[Union[s]]}], {60}]; s (* _Peter J. C. Moses_, Mar 21 2013 *)
%o A051120 (Haskell)
%o A051120 import Data.List (sort, nub, group)
%o A051120 a051120 n = a051120_list !! n
%o A051120 a051120_list = 1 : f [1] where
%o A051120   f xs = seen ++ (f $ xs ++ seen) where
%o A051120     seen = look (reverse $ map length $ group xs') (reverse $ nub xs')
%o A051120     xs' = sort xs
%o A051120     look [] []               = []
%o A051120     look (cnt:cnts) (nr:nrs) = cnt : nr : look cnts nrs
%o A051120 -- _Reinhard Zumkeller_, Jun 22 2011
%Y A051120 Cf. A005150, A079668, A055186, A079686.
%K A051120 nice,nonn,easy,base,look
%O A051120 0,4
%A A051120 Jamie (sunshinebaby(AT)hotmail.com)
%E A051120 More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
%E A051120 a(28) corrected by _Reinhard Zumkeller_, Jun 22 2011