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

A047842 Describe n (count digits in order of increasing value, ignoring missing digits).

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1011, 21, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1012, 1112, 22, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1013, 1113, 1213, 23, 1314, 1315, 1316, 1317, 1318, 1319, 1014, 1114, 1214, 1314, 24, 1415, 1416
Offset: 0

Views

Author

Keywords

Comments

Digit count of n. The digit count numerically summarizes the frequency of digits 0 through 9 in that order when they occur in a number. - Lekraj Beedassy, Jan 11 2007
Numbers which are digital permutations of one another have the same digit count. Compare with first entries of "Look And Say" or LS sequence A045918. As in the latter, a(n) has first odd-numbered-digit entry occurring at n=1111111111 with digit count 101, but a(n) has first ambiguous term 1011. For digit count invariants, i.e., n such that a(n)=n, see A047841. - Lekraj Beedassy, Jan 11 2007

Examples

			a(31) = 1113 because (one 1, one 3) make up 31.
101 contains one 0 and two 1's, so a(101) = 1021.
a(131) = 2113.
For n = 20231231, the digits of the date 2023-12-31, last day of 2023, a(n) = 10213223 is a fixed point: a(a(n)) = a(n) (cf. A235775). Since a(n) is invariant under permutation of the digits of n (leading zeros avoided), this is independent of the chosen notation, yyyy-mm-dd or mm/dd/yyyy or dd.mm.yyyy. - _M. F. Hasler_, Jan 11 2024
		

Crossrefs

Cf. A235775.
Cf. A244112 (the same but in order of decreasing value of digits), A010785.
Cf. A005150 (Look and Say: describe the number digit-wise instead of overall count).
Cf. A328447 (least m having the same digits as n).

Programs

  • Haskell
    import Data.List (sort, group); import Data.Function (on)
    a047842 :: Integer -> Integer
    a047842 n = read $ concat $
       zipWith ((++) `on` show) (map length xs) (map head xs)
       where xs = group $ sort $ map (read . return) $ show n
    -- Reinhard Zumkeller, Jan 15 2014
    
  • Mathematica
    dc[n_] :=FromDigits@Flatten@Select[Table[{DigitCount[n, 10, k], k}, {k, 0, 9}], #[[1]] > 0 &];Table[dc[n], {n, 0, 46}] (* Ray Chandler, Jan 09 2009 *)
    Array[FromDigits@ Flatten@ Map[Reverse, Tally@ Sort@ IntegerDigits@ #] &, 46] (* Michael De Vlieger, Jul 15 2020 *)
  • PARI
    A047842(n)={if(n, local(c=1, S="", d=vecsort(digits(n)), a(i)=Str(S, c, d[i])); for(i=2, #d, if(d[i]==d[i-1], c++, S=a(i-1); c=1)); eval(a(#d)), 10)} \\ M. F. Hasler, Feb 25 2018; edited Jan 10 2024
  • Python
    def A047842(n):
        s, x = '', str(n)
        for i in range(10):
            y = str(i)
            c = str(x.count(y))
            if c != '0':
                s += c+y
        return int(s) # Chai Wah Wu, Jan 03 2015
    

Formula

a(a(n)) = A235775(n). [By definition of A235775. - M. F. Hasler, Jan 11 2024]
a(A010785(n)) = A244112(A010785(n)). - Reinhard Zumkeller, Nov 11 2014
a(n) = a(A328447(n)) = a(m) for all n and all m having the same digits as n, with multiplicity. - M. F. Hasler, Jan 11 2024

Extensions

Edited by N. J. A. Sloane, Jul 03 2008 at the suggestion of R. J. Mathar

A006711 Describe previous term from the right (method A - initial term is 1).

Original entry on oeis.org

1, 11, 21, 1112, 1231, 11131211, 2112111331, 112331122112, 12212221231221, 11221113121132112211, 212221121321121113312221, 113211233112211213111221321112
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.

Examples

			E.g. the term after 1231 is obtained by saying "one 1, one 3, one 2, one 1", which gives 11131211.
		

References

  • J. H. Conway, personal communication.
  • Akhlesh Lakhtakia and C. A. Pickover, Observations on the Gleichniszahlen-Reihe: An Unusual Number Theory Sequence, J. Rec. Math., Vol. 25 #3, pp. 189-192, 1993.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

Formula

a(n+1) = A045918(A004086(a(n))). - Reinhard Zumkeller, Mar 02 2014

A022482 Describe previous term from the right (method A - initial term is 2).

Original entry on oeis.org

2, 12, 1211, 211211, 21122112, 1221222112, 122132112211, 2122211213112211, 21222113111221321112, 123112131122311321321112, 123112131112132113222113111221131211
Offset: 1

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.

Examples

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

Crossrefs

Programs

Formula

a(n+1) = A045918(A004086(a(n))). - Reinhard Zumkeller, Mar 02 2014

A022506 Describe previous term from the right (method A - initial term is 0).

Original entry on oeis.org

0, 10, 1011, 211011, 21102112, 122112102112, 122112101112212211, 2122112231101112212211, 21221122311021132221221112, 12312211321321121021132221221112
Offset: 0

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.

Examples

			The term after 1011 is obtained by saying "two 1's, one 0, one 1", which gives 211011.
		

Crossrefs

Programs

  • Haskell
    a022506 n = a022506_list !! n
    a022506_list = 0 : 10 : iterate (a045918 . a004086) 1011
    -- Reinhard Zumkeller, Mar 02 2014
  • Mathematica
    a[0] = 0;
    a[n_] := a[n] = Split[IntegerDigits[a[n-1]]] /. L_List /; IntegerQ[L[[1]]] :> {Length[L], L[[1]]} // Reverse // Flatten // FromDigits;
    a /@ Range[0, 9] (* Jean-François Alcover, Nov 26 2019 *)

Formula

For n > 1: a(n+1) = A045918(A004086(a(n))). - Reinhard Zumkeller, Mar 02 2014

Extensions

More terms from Erich Friedman

A056815 Primes with prime "look and say" descriptions.

Original entry on oeis.org

3, 7, 17, 23, 113, 127, 137, 193, 199, 223, 233, 271, 311, 313, 331, 359, 367, 373, 431, 433, 439, 463, 479, 499, 503, 523, 587, 607, 641, 677, 691, 733, 757, 773, 797, 809, 821, 823, 829, 853, 919, 997, 1009, 1069, 1123, 1129, 1171, 1181, 1187, 1223, 1277
Offset: 1

Views

Author

Joseph L. Pe, Jan 30 2003

Keywords

Comments

The "look and say" descriptions of some of these primes are themselves also terms of this sequence (for example, the one for 373). - Alonso del Arte, Mar 01 2012

Examples

			193 is prime and its "look and say" description A045918(193) = 111913, is also prime, so 193 belongs to the sequence.
		

References

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

Crossrefs

Programs

  • Haskell
    a056815 n = a056815_list !! (n-1)
    a056815_list = filter ((== 1) . a010051' . a045918) a000040_list
    -- Reinhard Zumkeller, Apr 14 2014
    
  • Mathematica
    LookAndSayA[ n_] := FromDigits@Flatten@((Through[ {Length, First}[ # ] ] &) /@ Split@IntegerDigits@n); Select[Prime@Range[210], PrimeQ@LookAndSayA@# &] (* Ray Chandler, Jan 12 2007 *)
    (* Emmanuel Vantieghem, Jan 26 2012, reports that the above Mma program is incorrect, because the LookAndSayA function can give wrong answers. Here is a better function (b and c to be substituted by suitable numbers): *)
    LookAndSayA[n_] := FromDigits@Flatten@(IntegerDigits/@Flatten@
    ((Through[{Length, First}[#]]&)/@Split@IntegerDigits@n)); W=Select[Prime@Range[b, c], PrimeQ@LookAndSayA@#&]
    (* Robert G. Wilson v then commented (Jan 27 2012) that the following version is cleaner: *)
    LookAndSayA[n_] := FromDigits@ Flatten@ IntegerDigits@ Flatten[
    Through[{Length, First}[#]] & /@ Split@ IntegerDigits@ n]
  • PARI
    forprime(p=1,999, isprime(A045918(p)) & print1(p","))  \\ M. F. Hasler, Jan 27 2012
    
  • Python
    from sympy import isprime, sieve
    from itertools import groupby, islice
    def LS(n): return int(''.join(str(len(list(g)))+k for k, g in groupby(str(n))))
    def agen(): yield from (p for p in sieve if isprime(LS(p)))
    print(list(islice(agen(), 51))) # Michael S. Branicky, Feb 03 2023

Formula

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

Extensions

Discussion of Mma program added Feb 02 2012 by N. J. A. Sloane

A022507 Describe previous term from the right (method A - initial term is 3).

Original entry on oeis.org

3, 13, 1311, 211311, 21132112, 122112132112, 122112131112212211, 2122112231131112212211, 21221122311321132221221112, 12312211321321121321132221221112
Offset: 0

Views

Author

Keywords

Comments

Method A = 'frequency' followed by 'digit'-indication.

Examples

			The term after 1311 is obtained by saying "two 1's, one 3, one 1", which gives 211311.
		

Crossrefs

Programs

Formula

a(n+1) = A045918(A004086(a(n))). - Reinhard Zumkeller, Mar 02 2014

Extensions

More terms from Erich Friedman

A260519 Concatenate the positions of digits 0, 1,..., 9 in the decimal representation of n, using 1 for the rightmost digit etc., and 0 when the digit does not occur.

Original entry on oeis.org

1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10, 1, 1200000000, 1200000000, 210000000, 201000000, 200100000, 200010000, 200001000, 200000100, 200000010, 200000001, 1020000000, 120000000, 120000000, 21000000, 20100000, 20010000, 20001000, 20000100, 20000010, 20000001
Offset: 0

Views

Author

M. F. Hasler, Jul 28 2015

Keywords

Examples

			Consider n=1103, the digit '0' is at 2nd position (looking from the right), digit '1' in 3rd and 4th place, digit '2' does not occur, digit '3' at 1st position, digits 4-9 do not occur. Thus a(1103) = 23401000000.
		

Crossrefs

Cf. A260520 - A260522 for variants; A045918 for the classical "look and say" sequence.

Programs

  • PARI
    a(n)={my(p=vector(10));for(i=1,#n=if(n,Vecrev(digits(n)),[0]),p[n[i]+1]=if(p[n[i]+1],concat(p[n[i]+1],i),i));p=concat(p);p[1]=Str(p[1]);eval(concat(p))}

A260522 Concatenate the positions of digits 9, 8,..., 0 in the decimal representation of n, using 1 for the leftmost digit etc., and 0 when the digit does not occur.

Original entry on oeis.org

1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 12, 120, 210, 2010, 20010, 200010, 2000010, 20000010, 200000010, 2000000010, 102, 120, 1200, 2100, 20100, 200100, 2000100, 20000100, 200000100, 2000000100
Offset: 0

Views

Author

M. F. Hasler, Jul 28 2015

Keywords

Examples

			Consider n=1103, digits '9' through '4' do not occur, digit '3' at 4th position, digit '2' does not occur, digit '1' in 1st and 2nd place, and digit '0' is at 3rd position. Thus a(1103) = 00000040123 = 40123.
		

Crossrefs

Cf. A045918 (the classical "look and say" sequence).
Cf. A260519 - A260521 for variants (counting from the right or starting with digit 0).

Programs

  • PARI
    a(n)={my(p=vector(10));for(i=1,#n=if(n,digits(n),[0]),p[n[i]+1]=if(p[n[i]+1],concat(p[n[i]+1],i),i));p=concat(Vecrev(p));p[1]=Str(p[1]);eval(concat(p))}

A329447 Start with a(0)=0; thereafter, look left and identify the least frequent digit d so far (in case of a tie, choose the smallest d): after then a(n) = 10c + d, where c > 0 is the number of times d has appeared so far.

Original entry on oeis.org

0, 10, 11, 20, 12, 22, 30, 13, 23, 33, 40, 14, 24, 34, 44, 50, 15, 25, 35, 45, 55, 60, 16, 26, 36, 46, 56, 66, 70, 17, 27, 37, 47, 57, 67, 77, 80, 18, 28, 38, 48, 58, 68, 78, 88, 90, 19, 29, 39, 49, 59, 69, 79, 89, 99, 100, 112, 113, 114, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 127, 128, 129
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Nov 14 2019

Keywords

Comments

The term "10c + d" are to be read "c digits d have appeared so far", as in the "look and see" sequences llike A045918.
It follows immediately from the definition that all terms are distinct. For a sorted list of the terms, see A376779. For a tabular method of computing a(n), see the triangle in A377905. - N. J. A. Sloane, Nov 11 2024
An analogous sequence may be obtained for any initial term a(0). Sequence A329448 lists the starting values that will appear a second time later in the respective sequence.

Crossrefs

Cf. A045918 (describe n), A005150 (the classic "Say What You See"), A139282 (count vowels so far), A139097 (count letters so far).
A376779 gives terms in increasing order. See also A377905.

Programs

  • Maple
    a[0]:= 0;
    S[0]:= 1:
    for i from 1 to 9 do S[i]:= 0 od:
    for n from 1 to 100 do
      a[n]:= min(select(`>=`,[seq(10*S[i]+i, i=0..9)],10));
      L:= convert(a[n],base,10);
      for d from 0 to 9 do S[d]:= S[d] + numboccur(d,L) od;
    od:
    seq(a[n],n=0..100); # Robert Israel, Nov 14 2019
  • PARI
    A329447_vec(N)={my(c=Vec(1,10),t); vector(N,i, for(j=1, #i=vecsort(c,,1), if(c[i[j]], i=i[j];break)); for(j=1, #i=digits(t=c[i]*10+i-1), c[i[j]+1]++);t)} \\ Returns the vector a(1..N)
    
  • Python
    from itertools import islice
    def agen():  # generator of terms
        counts = [1] + [0 for i in range(1, 10)]
        yield 0
        while True:
            m = float('inf')
            for i in range(10):
                if counts[i] and counts[i] < m:
                    m, argm = counts[i], i
            an = 10*m + argm
            yield an
            for d in str(an): counts[int(d)] += 1
    print(list(islice(agen(), 72))) # Michael S. Branicky, Nov 11 2024

Extensions

Edited by N. J. A. Sloane, Nov 10 2024

A045982 Describe all the previous terms!.

Original entry on oeis.org

1, 11, 31, 311311, 31131113211321, 3113111321132113211331131221131211, 31131113211321132113311312211312111321133113122113122113122123211311222113111221
Offset: 1

Views

Author

Keywords

Comments

Previous terms are concatenated into one large integer.
Next terms are 184, 420, 958 and 2194 digits long.

Crossrefs

Programs

  • Haskell
    a045982 n = a045982_list !! (n-1)
    a045982_list = 1 : f [1] where
       f xs = y : f (xs ++ [y]) where
         y = a045918 $ read (concatMap show xs)
    -- Reinhard Zumkeller, Feb 28 2014

Extensions

More terms from Patrick De Geest, Jun 15 1999
Previous Showing 21-30 of 59 results. Next