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

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

A079342 Integers k that divide LS(k), where LS is the "Look and Say" function (A045918).

Original entry on oeis.org

1, 2, 5, 10, 22, 32, 62, 91, 183, 188, 190, 196, 258, 276, 330, 671, 710, 1130, 1210, 1570, 2644, 2998, 3292, 4214, 17055, 20035, 53015, 70315, 101010, 108947, 199245, 233606, 309665, 323232, 356421, 483405, 626262, 919191, 1743599
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Feb 13 2003

Keywords

Comments

Infinite since s^i is a term for all odd i and s = 10, 32, 62, 91, 183, 190, 196, 258, 276, 671, 710, 1210, 1570, ..., where ^ denotes repeated concatenation of digits. - Michael S. Branicky, Aug 28 2024

Examples

			E.g. LS(1)=11, LS(2)=12, LS(10)=1110, LS(188)=1128 etc. and in each case LS(n) is a multiple of n.
122918=0 mod 2998, so 2998 is in the sequence.
But 13 == 1 mod 3, so 3 is not in the sequence.
		

Crossrefs

Cf. A152957. - David Wasserman, Dec 15 2008

Programs

  • Maple
    # Implementation by R. J. Mathar, May 08 2019:
    A045918 := proc(n)
        local a,f,pd,dgs,i ;
        a := [] ;
        f := 0 ;
        pd := -1 ;
        dgs := convert(n,base,10) ;
        for i from 1 to nops(dgs) do
            if op(-i,dgs) <> pd then
                if pd >= 0 then
                    a := [op(a),f,pd] ;
                end if;
                pd := op(-i,dgs) ;
                f := 1 ;
            else
                f:= f+1 ;
            end if;
        end do:
        a := [op(a),f,pd] ;
        digcatL(%) ;
    end proc:
    isA079342 := proc(n)
        simplify( modp(A045918(n) ,n) = 0 ) ;
    end proc:
    for n from 1 to 30000 do
        if isA079342(n) then
            print(n) ;
        end if;
    end do:
  • Python
    def LS(n): return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def ok(n): return LS(n)%n == 0
    print([k for k in range(1, 10**4) if ok(k)]) # Michael S. Branicky, Aug 28 2024

A127355 Primes with prime digit counts. The digit count numerically summarizes the frequency of digits 0 through 9 in that order when they occur in a number.

Original entry on oeis.org

3, 7, 17, 23, 71, 101, 103, 107, 109, 113, 127, 131, 137, 173, 199, 223, 233, 271, 311, 313, 317, 331, 359, 367, 409, 479, 499, 593, 673, 677, 701, 709, 773, 797, 907, 919, 929, 947, 953, 977, 991, 1009, 1123, 1129, 1193, 1213, 1217, 1223, 1231, 1277, 1291
Offset: 1

Views

Author

Lekraj Beedassy, Jan 11 2007

Keywords

Comments

Compare with "Look And Say" version A056815.

Examples

			The primes 479,991,1747 respectively have digit counts 141719 (one 4,one 7,one 9), 1129 (one 1, two 9's), 111427 (one 1, one 4, two 7's) which are also prime; So they belong to the sequence.
		

Crossrefs

Programs

  • Haskell
    a127355 n = a127355_list !! (n-1)
    a127355_list = filter ((== 1) . a010051' . a047842) a000040_list
    -- Reinhard Zumkeller, Apr 14 2014
  • Mathematica
    dc[n_] :=FromDigits@Flatten@Select[Table[{DigitCount[n, 10, k], k}, {k, 0, 9}], #[[1]] > 0 &];Select[Prime@Range[210], PrimeQ[dc[ # ]] &] (* Ray Chandler, Jan 16 2007 *)

Formula

A010051(a(n)) * A010051(A047842(a(n))) = 1. - Reinhard Zumkeller, Apr 14 2014

Extensions

Corrected by Ray Chandler, Jan 16 2007

A127176 Primes with prime "Look And Say" descriptions from left to right (irrespective of method A or method B).

Original entry on oeis.org

3, 7, 17, 23, 113, 137, 193, 271, 431, 479, 587, 691, 757, 809, 829, 1009, 1123, 1181, 1459, 2089, 2111, 2131, 2243, 2273, 2473, 2617, 2671, 3067, 3169, 3607, 3697, 4567, 4603, 5059, 5407, 5749, 6007, 6037, 6449, 6607, 6673, 7207, 7669, 7927, 8089, 8849
Offset: 1

Views

Author

Lekraj Beedassy, Jan 07 2007

Keywords

Examples

			137 and 1123, for instance, belong to the sequence because their respective descriptions 111317 (one 1, one 3, one 7) or 113171 (1 once, 3 once 7 once) and 211213 (two 1's, one 2, one 3) or 122131 (1 twice, 2 once, 3 once) are all primes.
		

Crossrefs

Formula

Intersection of A056815 and A127175.

Extensions

Corrected and extended by Ray Chandler, Jan 08 2007

A127175 Primes whose "Look And Say" descriptions from left to right (in the sense of method B, i.e., digit-indication followed by frequency) are also primes.

Original entry on oeis.org

3, 7, 17, 23, 41, 89, 113, 131, 137, 163, 179, 193, 271, 281, 283, 337, 389, 431, 443, 457, 479, 587, 593, 613, 661, 673, 683, 691, 727, 739, 757, 787, 809, 829, 863, 883, 907, 983, 1009, 1051, 1087, 1123, 1153, 1163, 1181, 1213, 1229, 1249, 1279, 1297
Offset: 1

Views

Author

Lekraj Beedassy, Jan 07 2007

Keywords

Examples

			41, 337, 809, 1123, for instance, are in the sequence because their respective descriptions 4111 (4 once, 1 once), 3271 (3 twice, 7 once), 810191 (8 once, 0 once, 9 once), 122131 (1 twice, 2 once, 3 once) are also primes.
		

Crossrefs

Programs

  • Mathematica
    LookAndSayB[ n_] := FromDigits@Flatten@((Through[ {First, Length}[ # ] ] &) /@ Split@IntegerDigits@n); Select[Prime@Range[215], PrimeQ@LookAndSayB@# &] (* Ray Chandler, Jan 08 2007 *)

Extensions

Corrected by Ray Chandler, Jan 08 2007

A204541 Semiprimes with semiprime "look and say" descriptions.

Original entry on oeis.org

4, 14, 15, 21, 22, 35, 38, 55, 57, 74, 87, 95, 119, 143, 145, 166, 187, 205, 215, 217, 247, 253, 254, 259, 278, 287, 289, 291, 305, 314, 335, 339, 341, 394, 403, 407, 427, 471, 493, 505, 514, 515, 517, 538, 553, 559, 565, 589, 614, 622, 623, 629, 633, 634, 649
Offset: 1

Views

Author

Robert G. Wilson v, Jan 27 2012

Keywords

Comments

Semiprime analogous to A056815.

Examples

			14 is in the sequence because 14 is a semiprime (2*7) and its "Look and Say", 1114 is also a semiprime (2*557).
		

Crossrefs

Programs

  • Mathematica
    LookAndSayA[n_] := FromDigits@ Flatten@ IntegerDigits@ Flatten[ Through[ {Length, First}[#]] & /@ Split@ IntegerDigits@ n]; semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; Select[ Range@ 650, semiPrimeQ@# && semiPrimeQ@ LookAndSayA@# &]

A205300 Least semiprime for which n-1 iterations of "Look & Say" (A045918) all yield semiprimes, but not the n-th iteration.

Original entry on oeis.org

6, 14, 4, 119, 933, 21161, 588821, 26600591
Offset: 1

Views

Author

Robert G. Wilson v, Jan 27 2012

Keywords

Comments

a(8) > 10^7. - Tyler Busby, Feb 07 2023
a(9) > 10^8. - Daniel Suteu, Feb 08 2023

Examples

			All of the following are the least semiprime with the required characteristics.
a(1) = 6 because 6 is a semiprime and its 'Look & Say' transformation A045918(6) = 16 is not a semiprime. (The smaller semiprime 4 yields LS(4)=14 which is again a semiprime.)
a(2) = 14 because both 14 and A045918(14)=1114 are semiprimes but LS(1114)=3114 is not.
a(3) = 4 because 4 (2*2), 14 (2*7) and 1114 (2*557) are all semiprimes but 3114 (2*3*3*173) is not.
		

Crossrefs

Programs

  • Mathematica
    LookAndSayA[n_] := FromDigits@ Flatten@ IntegerDigits@ Flatten[ Through[ {Length, First}[#]] & /@ Split@ IntegerDigits@ n]; semiPrimeQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; f[n_] := Block[{k = 1, truth = Append[Table[True, {n}], False]}, While[ semiPrimeQ@# & /@ NestList[ LookAndSayA, k, n] != truth, k++]; k]
  • PARI
    A205300(n) = for(a=4,1e9,bigomega(a)==2||next; my(t=a); for(k=2,n, bigomega(t=A045918(t))!=2 && next(2)); bigomega(A045918(t))==2 || return(a)) \\ M. F. Hasler, Jan 30 2012

Extensions

a(7) from Tyler Busby, Feb 07 2023
a(8) from Daniel Suteu, Feb 08 2023
a(5) corrected by Giovanni Resta, May 12 2025

A208834 Look and say sequence starting with 373.

Original entry on oeis.org

373, 131713, 111311171113, 311331173113, 1321232117132113, 1113121112131221171113122113, 311311123112111311222117311311222113, 132113311213211231132132211713211321322113
Offset: 1

Views

Author

Alonso del Arte, Mar 01 2012

Keywords

Comments

The first four terms are prime, thus the first three terms are members of A056815.
The fifth term is 17 * 18131 * 4286555419.

References

  • David Wells, Prime Numbers: The Most Mysterious Figures in Math. Hoboken, New Jersey: John Wiley & Sons (2005): p. 41

Crossrefs

Cf. A045918.

Programs

  • Mathematica
    (* First run one of the programs from A056815 to define the LookAndSay function *) NestList[LookAndSay, 373, 10]

A079350 "Look and Say" (or LS) transform of A079342(n). These terms are such that A079342(n) divides a(n).

Original entry on oeis.org

11, 12, 15, 1110, 22, 1312, 1612, 1911, 111813, 1128, 111910, 111916, 121518, 121716, 2310, 161711, 171110, 211310, 11121110, 11151710, 121624, 122918, 13121912, 14121114, 11171025, 12201315, 1513101115, 1710131115, 111011101110
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Feb 13 2003

Keywords

Examples

			E.g. 91 is in A079342, 1911=LS(91) and 91 divides 1911; 17055 is in A079342, 11171025=LS(17055) and 17055 divides 11171025. LS(n) is the "Look and Say" transform of n.
		

Crossrefs

For LS(n) see A045918. Cf. A056815, A005150, A079562, A079342.

Extensions

Revised Aug 13 2004

A336752 The 'Look and Say' sequence of the concatenation of the prime numbers A033308.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Aug 15 2020

Keywords

Comments

Concatenate all the decimal prime numbers, see A033308, then describe the resulting infinite string using the 'Look and Say' method of A005150.

Examples

			The concatenation of the primes starts "23571113171923293137...".
a(1) = 1, a(2) = 2 as there is one '2' at the start of the string.
a(9) = 3, a(10) = 1 as the primes '11' and '13' from the substring '1113'. which starts with three 1's.
		

Crossrefs

Showing 1-10 of 10 results.