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-7 of 7 results.

A001155 Describe the previous term! (method A - initial term is 0).

Original entry on oeis.org

0, 10, 1110, 3110, 132110, 1113122110, 311311222110, 13211321322110, 1113122113121113222110, 31131122211311123113322110, 132113213221133112132123222110, 11131221131211132221232112111312111213322110, 31131122211311123113321112131221123113111231121123222110
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
a(n), A001140, A001141, A001143, A001145, A001151 and A001154 are all identical apart from the last digit of each term (the seed). This is because digits other than 1, 2 and 3 never arise elsewhere in the terms (other than at the end of each of them) of look-and-say sequences of this type (as is mentioned by Carmine Suriano in A006751). - Chayim Lowen, Jul 16 2015
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			The term after 3110 is obtained by saying "one 3, two 1's, one 0", which gives 132110.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Mathematica
    A001155[1] := 0; A001155[n_] := A001155[n] = FromDigits[Flatten[{Length[#], First[#]}&/@Split[IntegerDigits[A001155[n-1]]]]]; Map[A001155,Range[15]] (* Peter J. C. Moses, Mar 21 2013 *)
  • PARI
    A001155(n,a=0)={ while(n--, my(c=1); for(j=2,#a=Vec(Str(a)), if( a[j-1]==a[j], a[j-1]=""; c++, a[j-1]=Str(c,a[j-1]); c=1)); a[#a]=Str(c,a[#a]); a=concat(a)); a }  \\ M. F. Hasler, Jun 30 2011
    
  • Python
    from itertools import accumulate, groupby, repeat
    def summarize(n, _): return int("".join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def aupton(terms): return list(accumulate(repeat(0, terms), summarize))
    print(aupton(11)) # Michael S. Branicky, Jun 28 2022

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

A244112 Reverse digit count of n in decimal representation.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1110, 21, 1211, 1311, 1411, 1511, 1611, 1711, 1811, 1911, 1210, 1211, 22, 1312, 1412, 1512, 1612, 1712, 1812, 1912, 1310, 1311, 1312, 23, 1413, 1513, 1613, 1713, 1813, 1913, 1410, 1411, 1412, 1413, 24, 1514, 1614, 1714
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 11 2014

Keywords

Comments

Frequencies of digits 0 through 9, occurring in n, are summarized in order of decreasing digits;
a(A010785(n)) = A047842(A010785(n)).

Examples

			101 contains two 1s and one 0, therefore a(101) = 2110;
102 contains one 2, one 1 and one 0, therefore a(102) = 121110.
		

Crossrefs

See A036058 for the orbit of 0 under this map.

Programs

  • Haskell
    import Data.List (sort, group); import Data.Function (on)
    a244112 :: Integer -> Integer
    a244112 n = read $ concat $
       zipWith ((++) `on` show) (map length xs) (map head xs)
       where xs = group $ reverse $ sort $ map (read . return) $ show n
    
  • Mathematica
    f[n_] := Block[{s = Split@ IntegerDigits@ n}, FromDigits@ Reverse@ Riffle[Union@ Flatten@ s, Length@# & /@ s]]; Array[f, 48, 0] (* Robert G. Wilson v, Dec 01 2016 *)
  • PARI
    A244112(n,c=1,S="")={for(i=2,#n=vecsort(digits(n),,4),n[i]==n[i-1]&&c++&&next;S=Str(S,c,n[i-1]);c=1);eval(Str(S,c,if(n,n[#n])))} \\ M. F. Hasler, Feb 25 2018
  • Python
    def A244112(n):
        return int(''.join([str(str(n).count(d))+d for d in '9876543210' if str(n).count(d) > 0])) # Chai Wah Wu, Dec 01 2016
    

A007890 Summarize the previous term! (in decreasing order).

Original entry on oeis.org

1, 11, 21, 1211, 1231, 131221, 132231, 232221, 134211, 14131231, 14231241, 24132231, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221, 14233221
Offset: 1

Views

Author

Keywords

Examples

			For example, the term after 131221 is obtained by saying "one 3, two 2's, three 1's", which gives 13-22-31, i.e. 132231.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, FromDigits@ Flatten@ Map[Reverse, Tally@ ReverseSort@ IntegerDigits@ #[[-1]] ] ] &, {1}, 24] (* Michael De Vlieger, Jul 15 2020 *)

Formula

From Seiichi Manyama, Aug 18 2020: (Start)
a(1) = 1 and a(n) = A244112(a(n-1)) for n > 1.
a(n) = 14233221 for n >= 13. (End)

A036212 When the 'Summarize preceding term' sequence gets into a cycle.

Original entry on oeis.org

11, 13, 12, 13, 9, 11, 11, 11, 11, 11, 10, 12, 11, 12, 8, 10, 10, 10, 10, 10, 7, 11, 1, 10, 7, 7, 7, 7, 7, 7, 9, 12, 10, 11, 7, 9, 9, 9, 9, 9, 10, 8, 7, 7, 8, 9, 10, 10, 10, 10, 11, 10, 7, 9, 9, 8, 10, 11, 11, 11, 13, 10, 7, 9, 10, 10, 8, 11, 13, 13, 14, 10, 7, 9, 10, 11, 11, 8, 13, 14
Offset: 0

Views

Author

Keywords

Examples

			a(0)=11 since the 'Summarize the previous term' sequence starting with 0 gets in a cycle from the 11th term.
		

Crossrefs

A036225 Length of cycle the 'summarize the previous term' sequence gets into.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 2, 3, 3, 3, 2, 1, 1, 1, 2, 2, 1, 3, 2, 2, 2, 1, 1, 1, 2, 3, 3, 1, 2, 2, 2, 1, 1, 1, 2, 3, 2, 2, 1, 2, 2, 1, 1, 1, 2, 3, 2, 2, 2, 1, 1
Offset: 0

Views

Author

Keywords

Comments

For n <= 10^7, a(n) <= 3. - A.H.M. Smeets, Jun 24 2019

Examples

			a(0)=1 because the 'Summarize the previous term' starting with 0 becomes constant and a(40)=2 because starting with 40 it gets into a cycle of two.
		

Crossrefs

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-7 of 7 results.