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.

Previous Showing 21-30 of 151 results. Next

A079560 Number of divisors of n-th term of Look and Say Sequence A005150.

Original entry on oeis.org

1, 2, 4, 4, 4, 2, 2, 16, 4, 4, 16, 8, 8, 32, 128, 128, 128, 32
Offset: 1

Views

Author

Joseph L. Pe, Jan 25 2003

Keywords

Comments

a(16) >= 32. - Nathaniel Johnston, Nov 02 2010

Crossrefs

Cf. A079562 [Nathaniel Johnston, Nov 02 2010]

Formula

a(n) = A000005(A005150(n)). - Michel Marcus, May 31 2020

Extensions

a(11)-a(15) from Nathaniel Johnston, Nov 02 2010
a(16)-a(17) from Giovanni Resta, May 31 2020
a(18) from Tyler Busby, Jan 25 2023

A079561 Sum of divisors of n-th term of Look and Say Sequence A005150.

Original entry on oeis.org

1, 12, 32, 1392, 121344, 312212, 13112222, 1279468800, 31136789207244, 13211311613063223000, 13403194265214368985974400, 3113112374374075507052715149610480, 1366689819219310568184630787187883678671578080
Offset: 1

Views

Author

Joseph L. Pe, Jan 25 2003

Keywords

Crossrefs

Formula

a(n) = A000203(A005150(n)). - Omar E. Pol, Dec 08 2019

Extensions

a(11)-a(12) from Nathaniel Johnston, Nov 02 2010
a(13) from Omar E. Pol, Dec 08 2019

A112457 a(1)=1; a(n+1)=desc(a(n))+a(n), where desc(x) is the description of x as in A005150.

Original entry on oeis.org

1, 12, 1124, 212338, 1211334656, 1112213525496172, 31221113152327355441607884, 1311223113111543352330284851467051780698, 111321221321133115142315123621344927293054493947386362638861942616
Offset: 1

Views

Author

Michele Dondi (blazar(AT)lcm.mi.infn.it), Sep 06 2005

Keywords

Examples

			Example a(2)=11+1=12, a(3)=1112+12=1124.
		

Crossrefs

Cf. A109229.

Programs

A334726 a(k) is the earliest start of sequence of exactly k primes generated according to the rules stipulated in A005150.

Original entry on oeis.org

1, 2, 3, 7, 373, 1223, 233, 19972667609, 75022592087629
Offset: 0

Views

Author

Giovanni Resta, May 09 2020

Keywords

Examples

			The sequence starting at 7 is 7 (prime), 17 (prime), 1117 (prime), and 3117 (composite), so a(3) = 7.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    from itertools import count, groupby, islice
    def LS(n):
        return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def f(n): return 0 if not isprime(n) else 1 + f(LS(n))
    def agen(startn=0, startk=1):
        n, adict = startn, {i:-1 for i in range(startn)}
        for k in count(startk):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 7))) # Michael S. Branicky, Jul 27 2022

A340036 Decimal expansion of sum of reciprocals of A005150(n) (where A005150(n) is the n-th term of the Look and Say sequence, Method A - initial term is 1).

Original entry on oeis.org

1, 1, 3, 9, 3, 6, 6, 1, 7, 3, 5, 9, 2, 6, 3, 9, 5, 2, 1, 1, 9, 1, 3, 4, 8, 9, 3, 5, 3, 1, 9, 9, 5, 8, 0, 8, 1, 9, 1, 8, 3, 6, 4, 2, 5, 6, 8, 0, 8, 2, 6, 4, 7, 6, 2, 7, 4, 3, 1, 3, 8, 5, 2, 0, 3, 5, 4, 9, 7, 6, 4, 9, 0, 8, 5, 0, 6, 7, 1, 6, 1, 5, 8, 3, 3, 9, 4
Offset: 1

Views

Author

Marco Ripà, Dec 26 2020

Keywords

Comments

The series a(n) := 1 + 1/11 + 1/21 + 1/1211 + 1/111221 + 1/312211 + ... converges to 1.139366173592639521191348935319958...

Examples

			1.139366173592639521191348935319958...
		

Crossrefs

Cf. A005150.

Formula

Equals Sum_{k>=1} 1/A005150(k).

Extensions

More terms from Amiram Eldar, Dec 27 2020

A355299 Largest prime factor of n-th term in Look and Say sequence A005150, with a(1)=1.

Original entry on oeis.org

1, 11, 7, 173, 10111, 312211, 13112221, 2909, 5578070441, 489923144699, 76572179303098543109, 244020609982169, 46889682313579293049990557739475858123, 213414262009265690085197238570402233414850657035591, 323082514382425741194809828536919444925509282219
Offset: 1

Views

Author

Bernard Schott, Jun 27 2022

Keywords

Comments

The terms in A005150 that are known to be primes are a(2) = 11, a(6) = 312211 and a(7) = 13112221 (A100108).
The corresponding smallest prime factor is A334132(n).

Examples

			A005150(7) = 13112221 is prime and a(7) = 13112221.
A005150(8) = 1113213211 = 11 * 19 * 1831 * 2909, hence a(8) = 2909.
		

Crossrefs

Formula

a(n) = A006530(A005150(n)).

A239455 Number of Look-and-Say partitions of n; see Comments.

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 7, 10, 13, 16, 21, 28, 33, 45, 55, 65, 83, 105, 121, 155, 180, 217, 259, 318, 362, 445, 512, 614, 707, 850, 958, 1155, 1309, 1543, 1754, 2079, 2327, 2740, 3085, 3592, 4042, 4699, 5253, 6093, 6815, 7839, 8751, 10069, 11208, 12832, 14266, 16270
Offset: 0

Views

Author

Keywords

Comments

Suppose that p = x(1) >= x(2) >= ... >= x(k) is a partition of n. Let y(1) > y(2) > ... > y(h) be the distinct parts of p, and let m(i) be the multiplicity of y(i) for 1 <= i <= h. Then we can "look" at p as "m(1) y(1)'s and m(2) y(2)'s and ... m(h) y(h)'s". Reversing the m's and y's, we can then "say" the Look-and-Say partition of p, denoted by LS(p). The name "Look-and-Say" follows the example of Look-and-Say integer sequences (e.g., A005150). As p ranges through the partitions of n, LS(p) ranges through all the Look-and-Say partitions of n. The number of these is A239455(n).
The Look-and-Say array is distinct from the Wilf array, described at A098859; for example, the number of Look-and-Say partitions of 9 is A239455(9) = 16, whereas the number of Wilf partitions of 9 is A098859(9) = 15. The Look-and-Say partition of 9 which is not a Wilf partition of 9 is [2,2,2,1,1,1].
Conjecture: a partition is Look-and-Say iff it has a permutation with all distinct run-lengths. For example, the partition y = (2,2,2,1,1,1) has the permutation (2,2,1,1,1,2), with run-lengths (2,3,1), which are all distinct, so y is counted under a(9). - Gus Wiseman, Aug 11 2025
Also the number of integer partitions y of n such that there is a pairwise disjoint way to choose a strict integer partition of each multiplicity (or run-length) of y. - Gus Wiseman, Aug 11 2025

Examples

			The 11 partitions of 6 generate 7 Look-and-Say partitions as follows:
6 -> 111111
51 -> 111111
42 -> 111111
411 -> 21111
33 -> 222
321 -> 111111
3111 -> 3111
222 -> 33
2211 -> 222
21111 -> 411
111111 -> 6,
so that a(6) counts these 7 partitions: 111111, 21111, 222, 3111, 33, 411, 6.
		

Crossrefs

These include all Wilf partitions, counted by A098859, ranked by A130091.
These partitions are listed by A239454 in graded reverse-lex order.
Non-Wilf partitions are counted by A336866, ranked by A130092.
A variant for runs is A351204, complement A351203.
The complement is counted by A351293, apparently ranked by A351295, conjugate A381433.
These partitions appear to be ranked by A351294, conjugate A381432.
The non-Wilf case is counted by A351592.
For normal multisets we appear to have A386580, complement A386581.
A000110 counts set partitions, ordered A000670.
A000569 = graphical partitions, complement A339617.
A003242 and A335452 count anti-runs, ranks A333489, patterns A005649.
A181819 = Heinz number of the prime signature of n (prime shadow).
A279790 counts disjoint families on strongly normal multisets.
A329738 = compositions with all equal run-lengths.
A386583 counts separable partitions, sums A325534, ranks A335433.
A386584 counts inseparable partitions, sums A325535, ranks A335448.
A386585 counts separable type partitions, sums A336106, ranks A335127.
A386586 counts inseparable type partitions, sums A386638 or A025065, ranks A335126.
Counting words with all distinct run-lengths:
- A032020 = binary expansions, for runs A351018, ranked by A044813.
- A329739 = compositions, for runs A351013, ranked by A351596.
- A351017 = binary words, for runs A351016.
- A351292 = patterns, for runs A351200.

Programs

  • Mathematica
    LS[part_List] := Reverse[Sort[Flatten[Map[Table[#[[2]], {#[[1]]}] &, Tally[part]]]]]; LS[n_Integer] := #[[Reverse[Ordering[PadRight[#]]]]] &[DeleteDuplicates[Map[LS, IntegerPartitions[n]]]]; TableForm[t = Map[LS[#] &, Range[10]]](*A239454,array*)
    Flatten[t](*A239454,sequence*)
    Map[Length[LS[#]] &, Range[25]](*A239455*)
    (* Peter J. C. Moses, Mar 18 2014 *)
    disjointFamilies[y_]:=Select[Tuples[IntegerPartitions/@Length/@Split[y]],UnsameQ@@Join@@#&];
    Table[Length[Select[IntegerPartitions[n],Length[disjointFamilies[#]]>0&]],{n,0,10}] (* Gus Wiseman, Aug 11 2025 *)

A045918 Describe n. Also called the "Say What You See" or "Look and Say" sequence LS(n).

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1110, 21, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1210, 1211, 22, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1310, 1311, 1312, 23, 1314, 1315, 1316, 1317, 1318, 1319, 1410, 1411, 1412, 1413, 24, 1415, 1416, 1417
Offset: 0

Views

Author

Keywords

Comments

a(1111111111) = a((10^10 - 1)/9) = 101 is the first term with an odd number of digits; 3-digit terms are unambiguous, but already the 2nd 4-digit term is LS( 12 ) = 1112 = LS( 2*(10^111-1)/9 ) ("hundred eleven 2's"). The smallest n such that LS(n) = LS(k) for some k < n (i.e. the largest n such that the restriction of LS to [0..n-1] is injective) appears to be 10*(10^11 - 1)/9 : LS(eleven '1's, one '0') = 11110 = LS(one '1', eleven '0's). - M. F. Hasler, Nov 14 2006
A121993 gives numbers m such that a(m) < m. - Reinhard Zumkeller, Jan 25 2014

Examples

			23 has "one 2, one 3", so a(23) = 1213.
		

References

  • J. H. Conway, The weird and wonderful chemistry of audioactive decay, in T. M. Cover and Gopinath, eds., Open Problems in Communication and Computation, Springer, NY 1987, pp. 173-188.

Crossrefs

Cf. A005150. See also A056815.

Programs

  • Haskell
    -- see Watkins link, p. 3.
    import Data.List (unfoldr, group); import Data.Tuple (swap)
    a045918 0 = 10
    a045918 n = foldl (\v d -> 10 * v + d) 0 $ say $ reverse $ unfoldr
       (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 10) n
       where say = concat . map code . group
             code xs = [toInteger $ length xs, head xs]
    -- Reinhard Zumkeller, Aug 09 2012
    
  • Maple
    LS:=n-> if n>9 then LS(op(convert(n,base,10))) else for i from 2 to nargs do if args[i] <> n then RETURN(( LS( args[i..nargs] )*10^length(i-1) + i-1)*10 + n ) fi od: 10*nargs + n fi; # M. F. Hasler, Nov 14 2006
  • Mathematica
    LookAndSayA[n_]  := FromDigits@ Flatten@ IntegerDigits@ Flatten[ Through[{Length, First}[#]] & /@ Split@ IntegerDigits@ n] (* Robert G. Wilson v, Jan 27 2012 *)
  • PARI
    A045918(a)={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]);eval(concat(a))}  \\ M. F. Hasler, Jan 27 2012
    
  • Python
    from re import finditer
    def A045918(n):
        return int(''.join([str(len(m.group(0)))+m.group(0)[0] for m in finditer(r'(\d)\1*',str(n))]))
    # Chai Wah Wu, Dec 03 2014
    
  • Python
    from itertools import groupby
    def LS(n): return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
    print([LS(n) for n in range(48)]) # Michael S. Branicky, Jul 27 2022

Extensions

Added Mma program from A056815. - N. J. A. Sloane, Feb 02 2012

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

A006751 Describe the previous term! (method A - initial term is 2).

Original entry on oeis.org

2, 12, 1112, 3112, 132112, 1113122112, 311311222112, 13211321322112, 1113122113121113222112, 31131122211311123113322112, 132113213221133112132123222112, 11131221131211132221232112111312111213322112, 31131122211311123113321112131221123113111231121123222112
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.
No digit exceeds 3. If the starting number a(1) is a single-digit number greater than 3 this will remain as the last digit, all the remaining in any term being no greater than 3. - Carmine Suriano, Sep 07 2010
a(n) = value of concatenation of n-th row in A088203. - Reinhard Zumkeller, Aug 09 2012
This is because for all n > 1, a(n) begins with 1 or 3 and ends with 2. - Jean-Christophe Hervé, May 07 2013
a(n+1) - a(n) is divisible by 10^5 for n > 5. - Altug Alkan, Dec 04 2015

Examples

			E.g. the term after 3112 is obtained by saying "one 3, two 1's, one 2", which gives 132112.
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 452-455.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Programs

  • Haskell
    a006751 = foldl1 (\v d -> 10 * v + d) . map toInteger . a088203_row
    -- Reinhard Zumkeller, Aug 09 2012
    
  • Mathematica
    RunLengthEncode[ x_List ] := (Through[ {First, Length}[ #1 ] ] &) /@ Split[ x ]; LookAndSay[ n_, d_:1 ] := NestList[ Flatten[ Reverse /@ RunLengthEncode[ # ] ] &, {d}, n - 1 ]; F[ n_ ] := LookAndSay[ n, 2 ][ [ n ] ]; Table[ FromDigits[ F[ n ] ], {n, 11} ] (* Zerinvary Lajos, Mar 21 2007 *)
  • Perl
    # This outputs the first n elements of the sequence, where n is given on the command line.
    $s = 2;
    for (2..shift @ARGV) {
        print "$s, ";
        $s =~ s/(.)\1*/(length $&).$1/eg;
    }
    print "$s\n";
    ## Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
    
  • Python
    l=[2]
    n=s=1
    y=''
    while n<21:
        x=str(l[n - 1]) + ' '
        for i in range(len(x) - 1):
            if x[i]==x[i + 1]: s+=1
            else:
                y+=str(s)+str(x[i])
                s=1
        x=''
        n+=1
        l.append(int(y))
        y=''
        s=1
    print(l) # Indranil Ghosh, Jul 05 2017

Formula

a(n+1) = A045918(a(n)). - Reinhard Zumkeller, Aug 09 2012
Previous Showing 21-30 of 151 results. Next