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 11-20 of 59 results. Next

A379454 Numbers that decrease three times in succession when they are iteratively replaced by the "Look and Say" description (cf. A045918) of their prime factors, counted with multiplicity.

Original entry on oeis.org

727974361, 2204693643, 2643690625
Offset: 1

Views

Author

Scott R. Shannon, Dec 23 2024

Keywords

Examples

			2643690625 is a term as 2643690625 = 5^5 * 845981 which becomes 551845981 when replaced by the "Look and Say" description of its prime factors, and 551845981 is smaller than 2643690625, 551845981 = 239^2 * 9661 which becomes 223919661 when replaced by the "Look and Say" description of its prime factors, and 223919661 is smaller than 551845981, and 223919661 = 3 * 7^5 * 4441 which becomes 135714441 when replaced by the "Look and Say" description of its prime factors, and 135714441 is smaller than 223919661.
		

Crossrefs

A103618 Number of steps required for n to reach a digit count invariant or cycle loop under the 'Look and Say' function A045918.

Original entry on oeis.org

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

Views

Author

Lekraj Beedassy, Mar 25 2005

Keywords

Examples

			a(10)=9 because we have the 9-step chain 10 -> 1011 -> 1031 -> 102113 -> 103112113 -> 10411223 -> 1031221314 -> 1041222314 -> 1031321324 -> 1031223314, the latter being autobiographical, hence invariant. Also, a(40)=9 since we have the digit count iteration 40 -> 1014 -> 102114 -> 10311214 -> 1041121314 -> 1051121324 -> 104122131415 -> 105122132415 -> 104132131425 -> 104122232415 <-> 103142132415, ending in a 2-cycle loop.
		

Crossrefs

Cf. A005151, A047841, A104785, A104786, A104787, A308781 (duplicate?).

Extensions

Corrected and extended by Sean A. Irvine, Feb 08 2010

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

A079480 a(1) = 1; a(2) = 2; a(n) = LS(a(n-1)) + LS(a(n-2)) if n > 2, where LS(m) = the "Look and Say" description (A045918) of m.

Original entry on oeis.org

1, 2, 23, 1225, 113428, 2113253433, 1221133328272641, 112221332439252927292834, 2132112312141319233733522435243624342725, 121113122112131112111411131119124449343834282634242925352431253324352529
Offset: 1

Views

Author

Joseph L. Pe, Jan 15 2003

Keywords

Examples

			E.g. a(7) = LS(a(6))+LS(a(5)). LS(a(6)) = LS(2113253433) = 1221131215131423, LS(a(5)) = LS(113428) = 2113141218 -> a(7) = 1221133328272641
		

Crossrefs

Programs

  • Mathematica
    RunLengthEncode[x_List] := (Through[{First, Length}[ #1]] &) /@ Split[x]; LS[n_] := FromDigits[ Reverse[ Flatten[ RunLengthEncode[ Reverse[ IntegerDigits[n]]]]]]; a[1] = 1; a[2] = 2; a[n_] := a[n] = LS[a[n - 1]] + LS[a[n - 2]]; Table[a[n], {n, 1, 10}]

Extensions

More terms from Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 24 2003
Corrected and edited by Robert G. Wilson v, Jan 27 2003

A097846 Differences between A097598 and A045918.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -99, 0, 99, 198, 297, 396, 495, 594, 693, 792, -198, -99, 0, 99, 198, 297, 396, 495, 594, 693, -297
Offset: 0

Views

Author

Odimar Fabeny, Aug 31 2004

Keywords

Crossrefs

A110744 Integers k such that k divides LS(k) or LS(k) divides 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, 777, 1130, 1210, 1570, 2644, 2998, 3292, 4214, 4444, 17055, 20035, 53015, 70315, 101010, 108947, 199245, 200000, 233606, 309665, 323232, 333000, 333333, 356421, 483405, 555555, 626262, 660000, 666666, 700000
Offset: 1

Views

Author

Amarnath Murthy, Aug 10 2005

Keywords

Comments

Union of A079342 and A152957.

Examples

			5 is a term because it is one 5, so LS(5) = 15, a multiple of 5.
4444 is a term because it is four 4's, so LS(4444) = 44, which divides 4444.
		

Crossrefs

Extensions

Corrected and extended by David Wasserman, Dec 15 2008

A121994 Smallest natural number that yields a sequence of n decreasing numbers under the "Look and Say" operator A045918.

Original entry on oeis.org

1, 33, 333, 333111, 33333333333333333333333333333333311111111111
Offset: 0

Views

Author

Sergio Pimentel, Sep 11 2006

Keywords

Comments

a(5) <= 33333333333333333333333333333333 '3's concatenated with 1111111111 '1's. - Tyler Busby, Feb 07 2023

Examples

			a(3)=333111 because under the Look and Say operator sequence A045918 it yields: 3331, 3311, 2321 which are all decreasing (3 in a row). The next term would be 12131211 which is greater than 2321.
		

Crossrefs

Extensions

a(4) from Sergio Pimentel, Mar 05 2008
a(4) corrected by Tyler Busby, Feb 07 2023

A247148 Primes p that divide LS(p), where LS is the "Look and Say" function (A045918).

Original entry on oeis.org

2, 5, 108947, 4940867
Offset: 1

Views

Author

G. L. Honaker, Jr., Nov 20 2014

Keywords

Comments

a(5) > 4*10^12. - Tyler Busby, Feb 02 2023

Examples

			a(2)=5, because 5 is prime and divides LS(5) or 15.
		

Crossrefs

Extensions

a(4) from Alois P. Heinz, Nov 20 2014

A005150 Look and Say sequence: describe the previous term! (method A - initial term is 1).

Original entry on oeis.org

1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, 31131211131221, 13211311123113112211, 11131221133112132113212221, 3113112221232112111312211312113211, 1321132132111213122112311311222113111221131221, 11131221131211131231121113112221121321132132211331222113112211, 311311222113111231131112132112311321322112111312211312111322212311322113212221
Offset: 1

Views

Author

Keywords

Comments

Method A = "frequency" followed by "digit"-indication.
Also known as the "Say What You See" sequence.
Only the digits 1, 2 and 3 appear in any term. - Robert G. Wilson v, Jan 22 2004
All terms end with 1 (the seed) and, except the third a(3), begin with 1 or 3. - Jean-Christophe Hervé, May 07 2013
Proof that 333 never appears in any a(n): suppose it appears for the first time in a(n); because of "three 3" in 333, it would imply that 333 is also in a(n-1), which is a contradiction. - Jean-Christophe Hervé, May 09 2013
This sequence is called "suite de Conway" in French (see Wikipédia link). - Bernard Schott, Jan 10 2021
Contrary to many accounts (including an earlier comment on this page), Conway did not invent the sequence. The first mention of the sequence appears to date back to the 1977 International Mathematical Olympiad in Belgrade, Yugoslavia. See the Editor's note on page 4, directly preceding Conway's article in Eureka referenced below. - Harlan J. Brothers, May 03 2024

Examples

			The term after 1211 is obtained by saying "one 1, one 2, two 1's", which gives 111221.
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 208.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, section 6.12 Conway's Constant, pp. 452-455.
  • M. Gilpin, On the generalized Gleichniszahlen-Reihe sequence, Manuscript, Jul 05 1994.
  • A. Lakhtakia and C. Pickover, Observations on the Gleichniszahlen-Reihe: An Unusual Number Theory Sequence, J. Recreational Math., 25 (No. 3, 1993), 192-198.
  • Clifford A. Pickover, Computers and the Imagination, St Martin's Press, NY, 1991.
  • Clifford A. Pickover, Fractal horizons: the future use of fractals, New York: St. Martin's Press, 1996. ISBN 0312125992. Chapter 7 has an extensive description of the elements and their properties.
  • C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 486.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, 1999, p. 23.
  • I. Vardi, Computational Recreations in Mathematica. Addison-Wesley, Redwood City, CA, 1991, p. 4.

Crossrefs

Cf. A001387, Periodic table: A119566.
Cf. A225224, A221646, A225212 (continuous versions).
Apart from the first term, all terms are in A001637.
About digits: A005341 (number of digits), A022466 (number of 1's), A022467 (number of 2's), A022468 (number of 3's), A004977 (sum of digits), A253677 (product of digits).
About primes: A079562 (number of distinct prime factors), A100108 (terms that are primes), A334132 (smallest prime factor).
Cf. A014715 (Conway's constant), A098097 (terms interpreted as written in base 4).

Programs

  • Haskell
    import List
    say :: Integer -> Integer
    say = read . concatMap saygroup . group . show
    where saygroup s = (show $ length s) ++ [head s]
    look_and_say :: [Integer]
    look_and_say = 1 : map say look_and_say
    -- Josh Triplett (josh(AT)freedesktop.org), Jan 03 2007
    
  • Haskell
    a005150 = foldl1 (\v d -> 10 * v + d) . map toInteger . a034002_row
    -- Reinhard Zumkeller, Aug 09 2012
    
  • Java
    See Paulo Ortolan link.
    
  • 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, 1 ][ [ n ] ]; Table[ FromDigits[ F[ n ] ], {n, 1, 15} ]
    A005150[1] := 1; A005150[n_] := A005150[n] = FromDigits[Flatten[{Length[#], First[#]}&/@Split[IntegerDigits[A005150[n-1]]]]]; Map[A005150, Range[25]] (* Peter J. C. Moses, Mar 21 2013 *)
  • PARI
    A005150(n,a=1)={ 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
  • Perl
    $str="1"; for (1 .. shift(@ARGV)) { print($str, ","); @a = split(//,$str); $str=""; $nd=shift(@a); while (defined($nd)) { $d=$nd; $cnt=0; while (defined($nd) && ($nd eq $d)) { $cnt++; $nd = shift(@a); } $str .= $cnt.$d; } } print($str);
    # Jeff Quilici (jeff(AT)quilici.com), Aug 12 2003
    
  • Perl
    # This outputs the first n elements of the sequence, where n is given on the command line.
    $s = 1;
    for (2..shift @ARGV) {
    print "$s, ";
    $s =~ s/(.)\1*/(length $&).$1/eg;
    }
    # Arne 'Timwi' Heizmann (timwi(AT)gmx.net), Mar 12 2008
    print "$s\n";
    
  • Python
    def A005150(n):
        p = "1"
        seq = [1]
        while (n > 1):
            q = ''
            idx = 0 # Index
            l = len(p) # Length
            while idx < l:
                start = idx
                idx = idx + 1
                while idx < l and p[idx] == p[start]:
                    idx = idx + 1
                q = q + str(idx-start) + p[start]
            n, p = n - 1, q
            seq.append(int(p))
        return seq
    # Olivier Mengue (dolmen(AT)users.sourceforge.net), Jul 01 2005
    
  • Python
    def A005150(n):
        seq = [1] + [None] * (n - 1) # allocate entire array space
        def say(s):
            acc = '' # initialize accumulator
            while len(s) > 0:
                i = 0
                c = s[0] # char of first run
                while (i < len(s) and s[i] == c): # scan first digit run
                    i += 1
                acc += str(i) + c # append description of first run
                if i == len(s):
                    break # done
                else:
                    s = s[i:] # trim leading run of digits
            return acc
        for i in range(1, n):
            seq[i] = int(say(str(seq[i-1])))
        return seq
    # E. Johnson (ejohnso9(AT)earthlink.net), Mar 31 2008
    
  • Python
    # program without string operations
    def sign(n): return int(n > 0)
    def say(a):
        r = 0
        p = 0
        while a > 0:
            c = 3 - sign((a % 100) % 11) - sign((a % 1000) % 111)
            r += (10 * c + (a % 10)) * 10**(2*p)
            a //= 10**c
            p += 1
        return r
    a = 1
    for i in range(1, 26):
        print(i, a)
        a = say(a)
    # Volker Diels-Grabsch, Aug 18 2013
    
  • Python
    import re
    def lookandsay(limit, sequence = 1):
        if limit > 1:
            return lookandsay(limit-1, "".join([str(len(match.group()))+match.group()[0] for matchNum, match in enumerate(re.finditer(r"(\w)\1*", str(sequence)))]))
        else:
            return sequence
    # lookandsay(3) --> 21
    # Nicola Vanoni, Nov 29 2016
    
  • Python
    import itertools
    x = "1"
    for i in range(20):
        print(x)
        x = ''.join(str(len(list(g)))+k for k,g in itertools.groupby(x))
    # Matthew Cotton, Nov 12 2019
    

Formula

a(n+1) = A045918(a(n)). - Reinhard Zumkeller, Aug 09 2012
a(n) = Sum_{k=1..A005341(n)} A034002(n,k)*10^(A005341(n)-k). - Reinhard Zumkeller, Dec 15 2012
a(n) = A004086(A007651(n)). - Bernard Schott, Jan 08 2021
A055642(a(n+1)) = A005341(n+1) = 2*A043562(a(n)). - Ya-Ping Lu, Jan 28 2025
Conjecture: DC(a(n)) ~ k * (Conway's constant)^n where k is approximately 1.021... and DC denotes the number of digit changes in the decimal representation of n (e.g., DC(13112221)=4 because 1->3, 3-1, 1->2, 2->1). - Bill McEachen, May 09 2025
Conjecture: lim_{n->infinity} (c2+c3-c1)/(c1+c2+c3) = 0.01 approximately, where ci is the number of appearances of 'i' in a(n). - Ya-Ping Lu, Jun 05 2025

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 11-20 of 59 results. Next