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.

A300191 Look and Say the digits of the last three terms, by increasing digit value. Start with a(1)=1, a(2)=2 and a(3)=3.

Original entry on oeis.org

1, 2, 3, 111213, 412223, 51423314, 7152433415, 515253543517, 613263548527, 5142634495263718, 515263549546372819, 516263648566373839, 515283648596374849, 414283649596376859, 3132837475106377869, 10413283746576677869, 20513283644596976859, 30514283545596976859
Offset: 1

Views

Author

Paolo P. Lava, Feb 28 2018

Keywords

Comments

From the 1458th term the sequence goes into a cycle of 850 terms.

Examples

			1, 2, 3 => there are one '1', one '2' and one '3': 111213;
2, 3, 111213 => there are four '1', two '2' and two '3': 412223;
3, 111213, 412223 => there are five '1', four '2', three '3', one '4': 51423314.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,c,d,k,n,y,x; y:=array(1..3); x:=array(0..9);
    y[1]:=1; y[2]:=2; y[3]:=3;
    print(1); print(2); print(3); a:=[]; b:=[1]; c:=[2];
    for n from 1 to q do for k from 0 to 9 do x[k]:=0; od;
    a:=b; b:=c; c:=convert(y[3],base,10);
    for k from 1 to nops(a) do x[a[k]]:=x[a[k]]+1; od;
    for k from 1 to nops(b) do x[b[k]]:=x[b[k]]+1; od;
    for k from 1 to nops(c) do x[c[k]]:=x[c[k]]+1; od;
    y[1]:=y[2]; y[2]:=y[3]; y[3]:=0;
    for k from 0 to 9 do if x[k]>0 then if k=0 then d:=10*x[k];
    else d:=10*x[k]+k; fi; y[3]:=y[3]*10^(ilog10(d)+1)+d; fi; od;
    print(y[3]); od; end: P(10^2);
  • Mathematica
    Nest[Append[#, FromDigits[Join @@ Map[Flatten@ Reverse@ # &, IntegerDigits@ Sort@ Tally[Join @@ IntegerDigits[#[[-3 ;; -1]]]]]]] &, {1, 2, 3}, 15] (* Michael De Vlieger, Mar 01 2018 *)