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

A005151 Summarize the previous term (digits in increasing order), starting with a(1) = 1.

Original entry on oeis.org

1, 11, 21, 1112, 3112, 211213, 312213, 212223, 114213, 31121314, 41122314, 31221324, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314, 21322314
Offset: 1

Views

Author

Keywords

Comments

a(n) = 21322314 for n > 12. - Reinhard Zumkeller, Jan 25 2014
The digits of each term a(n) are a permutation of those of the corresponding term A063850(n). - Chayim Lowen, Jul 16 2015

Examples

			The term after 312213 is obtained by saying "Two 1's, two 2's, two 3's", which gives 21-22-23, i.e., 212223.
		

References

  • C. Fleenor, "A litteral sequence", Solution to Problem 2562, Journal of Recreational Mathematics, vol. 31 No. 4 pp. 307 2002-3 Baywood NY.
  • Problem in J. Recreational Math., 30 (4) (1999-2000), p. 309.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A005150, A047842. See A083671 for another version.

Programs

  • Haskell
    import Data.List (group, sort, transpose)
    a005151 n = a005151_list !! (n-1)
    a005151_list = 1 : f [1] :: [Integer] where
       f xs = (read $ concatMap show ys) : f ys where
              ys = concat $ transpose [map length zss, map head zss]
              zss = group $ sort xs
    -- Reinhard Zumkeller, Jan 25 2014
    
  • Mathematica
    RunLengthEncode[x_List] := (Through[{Length, First}[ #1]] &) /@ Split[ Sort[x]]; LookAndSay[n_, d_:1] := NestList[ Flatten[ RunLengthEncode[ # ]] &, {d}, n - 1]; F[n_] := LookAndSay[n, 1][[n]]; Table[ FromDigits[ F[n]], {n, 25}] (* Robert G. Wilson v, Jan 22 2004 *)
    a[1] = 1; a[n_] := a[n] = FromDigits[Reverse /@ Sort[Tally[a[n-1] // IntegerDigits], #1[[1]] < #2[[1]]&] // Flatten]; Array[a, 26] (* Jean-François Alcover, Jan 25 2016 *)
  • PARI
    say(n) = {digs = digits(n); d = vecsort(digs,,8); s = ""; for (k=1, #d, nbk = #select(x->x==d[k], digs); s = concat(s, Str(nbk)); s = concat(s, d[k]);); eval(s);}
    lista(nn) = {print1(n = 1, ", "); for (k=1, nn, m = say(n); print1(m, ", "); n = m;);} \\ Michel Marcus, Feb 12 2016
    
  • PARI
    a(n,show_all=1,a=1)={for(i=2,n,show_all&&print1(a",");a=A047842(a));a} \\ M. F. Hasler, Feb 25 2018
    
  • PARI
    Vec(x*(1 + 10*x + 10*x^2 + 1091*x^3 + 2000*x^4 + 208101*x^5 + 101000*x^6 - 99990*x^7 - 98010*x^8 + 31007101*x^9 + 10001000*x^10 - 9900990*x^11 - 9899010*x^12) / (1 - x) + O(x^40)) \\ Colin Barker, Aug 23 2018
    
  • Python
    from itertools import accumulate, groupby, repeat
    def summarize(n, _):
      return int("".join(str(len(list(g)))+k for k, g in groupby(sorted(str(n)))))
    def aupton(nn): return list(accumulate(repeat(1, nn+1), summarize))
    print(aupton(25)) # Michael S. Branicky, Jan 11 2021

Formula

a(n+1) = A047842(a(n)). - M. F. Hasler, Feb 25 2018
G.f.: x*(1 + 10*x + 10*x^2 + 1091*x^3 + 2000*x^4 + 208101*x^5 + 101000*x^6 - 99990*x^7 - 98010*x^8 + 31007101*x^9 + 10001000*x^10 - 9900990*x^11 - 9899010*x^12) / (1 - x). - Colin Barker, Aug 23 2018

A262721 Modified Look and Say sequence: compute sum of digits of previous term, square it, and apply the "Say What You See" process.

Original entry on oeis.org

1, 11, 14, 1215, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116
Offset: 0

Views

Author

Abdul Gaffar Khan, Sep 28 2015

Keywords

Comments

1. Generated with the help of sequence generated as follows:
c(0)=b, c(n)=k-th power of sum of digits of c(n-1).
Example: c(0)=1, c(n)=1 for all k hence convergent.
Example: c(0)=2, k=2, c(1)=4, c(2)=16, c(3)=49 as (1+6)^2=49.
Example: c(0)=3, k=2, c(n)=81 for all n, hence convergent.
In fact, for c(0)=3 and any k, a sequence generated by using this method converges.
(Methods G, V1 and V2 are explain in Link attached, namely "Generalization of A262721")
2. Every sequence generated by c(0)=b and any k, by using G, V1 or V2 has at least two convergent subsequences or in other words sequence generated by method G, V1 or V2 never converges for any b and k.
(2.1) For a(0)=1, k=2, and method G has 6 convergent subsequences with initial terms 1, 11, 14 and 1215 and converging to 1811, 111211, 1419, 2215, 1120, or 1116.
(2.2) For c(0)=1, k=2, and method V1 has 2 convergent subsequences with initial terms 1, 11, 14, 1215, 1118, 2112 and converging to 1316 and 2112.
(2.3) For c(0)=1, k=2, and method V2 has 2 convergent subsequences with initial terms 1, 11, 14, 15125, 1811, 1221 and converging to 1613 and 1221.
3. For any b and k, the least 'g-th' term of the sequence generated by methods G, V1 or V2 reaches a point at which one of the convergent subsequence of generated sequence,converges. That is, c(g) will be the converging point of one of the subsequence of generated sequence, but there is no subsequence which converges to the term c(m),m=0,...,g-1,with initial term read as c(0).
(3.1) For a(0)=1, k=2, method G we have g=4 with converging point 1811 by refering (2.1).
(3.2) For c(0)=1, k=2, method V1 we have g=5, with converging point 2112.
(3.3) For c(0)=1, k=2, method V2 we have g=5, with converging point 1221.
(3.4) For any b and k, the value of g for methods V1 and V2 is the same.
4. For method G, V1 or V2 with c(0)=b and k chosen randomly, the following holds:
(I) g<=k*23, for b=1 and for k<=100
(II) g<=k*23*b for k<=100
(III) g<=k*(23^(b+1)) for large values of k.
5. In the manner of A083671, sequence become periodic from 5th row with period of 6.

Examples

			a(0) = 1 has 1 digit, and the sum of digits is 1, and the square of the sum of digits is 1. So a(1) = 11, that is, one times 1.
a(1) = 11 has 2 digits, and the sum of digits is 1+1=2 and the square of the sum of digits is 4. So a(2) = 14, that is, one times 4.
Since a(2)=14, we compute 1+4=5, 5^2 = 25, where we see one 2 and one 5, so a(3)=1215.
		

Crossrefs

Cf. A005150 (Look and Say).
Cf. A118881 (square of sum of digits of n).
Cf. A005151 (Summarize the previous term! (in increasing order)).
Cf. A007890 (Summarize the previous term! (in decreasing order)).
Cf. A045918 (Describe n. Also called the "Say What You See" or "Look and Say" sequence LS(n).)

Programs

  • Mathematica
    A262721[0] := 1;
    A262721[n_] :=
    A262721[n] =
      FromDigits[
       Flatten[{Length[#], First[#]} & /@
         Split[IntegerDigits[
           Total[IntegerDigits[A262721[n - 1]]]^2]]]]; Table[
    A262721[n], {n, 0, 100}]
  • PARI
    say(n) = {d = digits(n); da = d[1]; na = 1; s = ""; for (k=2, #d, if (d[k] == da, na++, s = concat(s, Str(na, da)); na = 1; da = d[k]);); s = concat(s, Str(na, da)); eval(s);}
    lista(nn) = {print1(a=1, ", "); for (k=2, nn, a = say(sumdigits(a)^2); print1(a, ", "););} \\ Michel Marcus, Sep 29 2015

Formula

1. a(0) = 1, a(n) = 'frequency' of digits in the square of the sum of digits of a(n-1) followed by 'digit'-indication.
2. a(0) = 1, a(n) = A005150(A118881(a(n-1))). Here first deal with the type of operations of A118881 on a(n-1)-th term and then deal with the operation of A005150 on obtained value from A118881(a(n-1)) in last step, instead of following a(n-1) term of A118881 and A118881(a(n-1)) as a member of sequences A118881 and A005150 respectively.
a(0) = 1, a(n) = A045918(A118881(a(n-1))).
Showing 1-2 of 2 results.