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.

Showing 1-3 of 3 results.

A036059 The summarize Fibonacci sequence: summarize the previous two terms!.

Original entry on oeis.org

1, 1, 21, 1221, 3231, 233231, 533221, 15534221, 3514334231, 3534533241, 3544832231, 183544733221, 28172544634231, 2827162554535241, 2827265554337241, 2837267544338231, 3847264544637221, 3847362564636221, 2837662564536221, 2827863534537221, 3837564524538221
Offset: 0

Views

Author

Keywords

Comments

After the 23rd term the sequence goes into a cycle of 16 terms.

Examples

			a(20) = 3837564524538221;
a(21) = 4837265534637221;
a(22+16*k) = 3837365544636221, k >= 0;
a(36) = a(20+16) = 3837265554834221 <> a(20);
a(37) = a(21+16) = 3837266544735221 <> a(21);
a(38) = a(22+16) = 3837365544636221 = a(22). - _Reinhard Zumkeller_, Aug 10 2014
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort, group)
    a036059 n = a036059_list !! n
    a036059_list = map (read . concatMap show) fss :: [Integer] where
       fss = [1] : [1] : zipWith h (tail fss) fss where
             h vs ws = concatMap (\us -> [length us, head us]) $
                       group $ reverse $ sort $ vs ++ ws
    -- Reinhard Zumkeller, Aug 10 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n<2, 1, (p-> parse(cat(seq((c->
         `if`(c=0, [][], [c, 9-i][]))(coeff(p, x, 9-i)), i=0..9))))(
          add(x^i, i=map(x-> convert(x, base, 10)[], [a(n-1),a(n-2)]))))
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Jun 18 2022
  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = FromDigits @ Flatten @ Reverse @ Select[ Transpose @ { DigitCount[a[n-1]] + DigitCount[a[n-2]], Append[ Range[9], 0]}, #[[1]] > 0&];
    Table[a[n], {n, 0, 18}] (* Jean-François Alcover, Dec 30 2017 *)
  • Python
    def aupton(nn):
      alst = [1, 1]
      for n in range(2, nn+1):
        prev2, anstr = sorted(str(alst[-2]) + str(alst[-1])), ""
        for d in sorted(set(prev2), reverse=True):
          anstr += str(prev2.count(d)) + d
        alst.append(int(anstr))
      return alst
    print(aupton(20)) # Michael S. Branicky, Feb 02 2021

A036058 Summarize digits of preceding number, by decreasing digit value. Start with a(0) = 0.

Original entry on oeis.org

0, 10, 1110, 3110, 132110, 13123110, 23124110, 1413223110, 1423224110, 2413323110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110, 1433223110
Offset: 0

Views

Author

Keywords

Comments

This kind of counting sequence is always eventually periodic with period 1, 2 or 3. - Herve Lehning (lehning(AT)noos.fr), Oct 01 2003

Examples

			The third term is 1110 because the second term contains one 1 and one 0.
		

Crossrefs

Cf. A007890 (same as this, starting at 1), A001155 (same as this, but using method A047842: by increasing digit value), A005150 (as before, starting at 1), A036059 ("fibonacci" based on this), A036066.

Programs

  • PARI
    a(n)=if(n>9,1433223110,[0,10,1110,3110,132110,13123110,23124110,1413223110, 1423224110,2413323110][n+1]) \\ Charles R Greathouse IV, Jul 24 2012
    
  • PARI
    a(n,a=0)={for(k=1,n,a==(a=A244112(a))&&break);a} \\ M. F. Hasler, Feb 25 2018

Formula

a(n+1) = A244112(a(n)), a(0) = 0. - M. F. Hasler, Feb 25 2018

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 *)
Showing 1-3 of 3 results.