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

A010785 Repdigit numbers, or numbers whose digits are all equal.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 11111, 22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999, 111111, 222222, 333333, 444444, 555555, 666666
Offset: 0

Views

Author

Keywords

Comments

Complement of A139819. - David Wasserman, May 21 2008
Subsequence of A134336 and of A178403. - Reinhard Zumkeller, May 27 2010
Subsequence of A193460. - Reinhard Zumkeller, Jul 26 2011
Intersection of A009994 and A009996. - David F. Marrs, Sep 29 2018
Beiler (1964) called these numbers "monodigit numbers". The term "repdigit numbers" was used by Trigg (1974). - Amiram Eldar, Jan 21 2022

References

  • Albert H. Beiler, Recreations in the Theory of Numbers, Dover, New York, 1964, p. 83.

Crossrefs

Programs

  • Haskell
    a010785 n = a010785_list !! n
    a010785_list = 0 : r [1..9] where
       r (x:xs) = x : r (xs ++ [10*x + x `mod` 10])
    -- Reinhard Zumkeller, Jul 26 2011
    
  • Magma
    [(n-9*Floor((n-1)/9))*(10^Floor((n+8)/9)-1)/9: n in [0..50]]; // Vincenzo Librandi, Nov 10 2014
    
  • Maple
    A010785 := proc(n)
        (n-9*floor(((n-1)/9)))*((10^(floor(((n+8)/9)))-1)/9) ;
    end proc:
    seq(A010785(n), n = 0 .. 100); # Robert Israel, Nov 09 2014
  • Mathematica
    fQ[n_]:=Module[{id=IntegerDigits[n]}, Length[Union[id]]==1]; Select[Range[0,10000], fQ] (* Vladimir Joseph Stephan Orlovsky, Dec 29 2010 *)
    Union[FromDigits/@Flatten[Table[PadRight[{},i,n],{n,0,9},{i,6}],1]] (* or *) LinearRecurrence[{0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,-10}, {0,1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88},40] (* Harvey P. Dale, Dec 28 2011 *)
    Union@ Flatten@ Table[k (10^n - 1)/9, {k, 0, 9}, {n, 6}] (* Robert G. Wilson v, Oct 09 2014 *)
    Table[(n - 9 Floor[(n-1)/9]) (10^Floor[(n+8)/9] - 1)/9, {n, 0, 50}] (* José de Jesús Camacho Medina, Nov 06 2014 *)
  • PARI
    a(n)=10^((n+8)\9)\9*((n-1)%9+1) \\ Charles R Greathouse IV, Jun 15 2011
    
  • PARI
    nxt(n,t=n%10)=if(t<9,n*(t+1),n*10+9)\t \\ Yields the term a(k+1) following a given term a(k)=n. M. F. Hasler, Jun 24 2016
    
  • PARI
    is(n)={1==#Set(digits(n))}
    inv(n) = 9*#Str(n) + n%10 - 9 \\ David A. Corneth, Jun 24 2016
    
  • Python
    def a(n): return 0 if n == 0 else int(str((n-1)%9+1)*((n-1)//9+1))
    print([a(n) for n in range(55)]) # Michael S. Branicky, Dec 29 2021
    
  • Python
    print([0]+[int(d*r) for r in range(1, 7) for d in "123456789"]) # Michael S. Branicky, Dec 29 2021
    
  • Python
    # without string operations
    def a(n): return 0 if n == 0 else (10**((n-1)//9+1)-1)//9*((n-1)%9+1)
    print([a(n) for n in range(55)]) # Michael S. Branicky, Nov 03 2023

Formula

A037904(a(n)) = 0. - Reinhard Zumkeller, Dec 14 2007
A178401(a(n)) > 0. - Reinhard Zumkeller, May 27 2010
From Reinhard Zumkeller, Jul 26 2011: (Start)
For n > 0: A193459(a(n)) = A000005(a(n)).
for n > 10: a(n) mod 10 = floor(a(n)/10) mod 10.
A010879(n) = A010879(A059995(n)). (End)
A202022(a(n)) = 1. - Reinhard Zumkeller, Dec 09 2011
a(0)=0, a(1)=1, a(2)=2, a(3)=3, a(4)=4, a(5)=5, a(6)=6, a(7)=7, a(8)=8, a(9)=9, a(10)=11, a(11)=22, a(12)=33, a(13)=44, a(14)=55, a(15)=66, a(16)=77, a(17)=88, a(n) = 11*a(n-9) - 10*a(n-18). - Harvey P. Dale, Dec 28 2011
A151949(a(n)) = 0; A180410(a(n)) = A227362(a(n)). - Reinhard Zumkeller, Jul 09 2013
a(n) = (n - 9*floor((n-1)/9))*(10^floor((n+8)/9) - 1)/9. - José de Jesús Camacho Medina, Nov 06 2014
G.f.: x*(1+2*x+3*x^2+4*x^3+5*x^4+6*x^5+7*x^6+8*x^7+9*x^8)/((1-x^9)*(1-10*x^9)). - Robert Israel, Nov 09 2014
A047842(a(n)) = A244112(a(n)). - Reinhard Zumkeller, Nov 11 2014
Sum_{n>=1} 1/a(n) = (7129/2520) * A065444 = 3.11446261209177581335... - Amiram Eldar, Jan 21 2022

Extensions

Name clarified by Jon E. Schoenfield, Nov 10 2023

A004185 Arrange digits of n in increasing order, then (for n > 0) omit the zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12, 22, 23, 24, 25, 26, 27, 28, 29, 3, 13, 23, 33, 34, 35, 36, 37, 38, 39, 4, 14, 24, 34, 44, 45, 46, 47, 48, 49, 5, 15, 25, 35, 45, 55, 56, 57, 58, 59, 6, 16, 26, 36, 46, 56, 66, 67, 68, 69, 7, 17, 27, 37, 47
Offset: 0

Views

Author

Keywords

Comments

Record values: A009994. - Reinhard Zumkeller, Dec 05 2009
If we define "sortable primes" as prime numbers that remain prime when their digits are sorted in increasing order, then all absolute primes (A003459) are sortable primes but not all sortable primes are absolute primes. For example, 311 is both sortable and absolute, and 271 is sortable but not absolute, since its digits can be permuted to 217 = 7 * 31 or 712 = 2^3 * 89, etc. - Alonso del Arte, Oct 05 2013
The above mentioned "sortable primes" are listed in A211654, the nontrivial ones (with digits not in nondecreasing order) in A086042. - M. F. Hasler, Jul 30 2019

Examples

			a(19) = 19 because the digits are already in increasing order.
a(20) = 2 because the digits of 20 are 2 and 0, which in increasing order are 0 and 2, but since zero-padding is not allowed on the left, the zero digit is dropped and we are left with 2.
a(21) = 12 because the digits of 21 are 2 and 1, which in increasing order are 1 and 2.
		

Crossrefs

Cf. A211654 (sortable primes) and subsequence A086042 (nontrivial solutions).

Programs

  • Haskell
    import Data.List (sort)
    a004185 n = read $ sort $ show n :: Integer
    -- Reinhard Zumkeller, Aug 10 2011
    
  • Magma
    A004185:=func; [n eq 0 select 0 else A004185(n): n in [0..57]]; // Bruno Berselli, Apr 03 2012
    
  • Maple
    A004185 := proc(n)
        local dgs;
        convert(n,base,10) ;
        dgs := sort(%,`>`) ;
        add( op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
    end proc:
    seq(A004185(n),n=0..20) ; # R. J. Mathar, Jul 26 2015
  • Mathematica
    FromDigits[Sort[DeleteCases[IntegerDigits[#], 0]]]&/@Range[0, 60] (* Harvey P. Dale, Nov 29 2011 *)
  • PARI
    a(n)=fromdigits(vecsort(digits(n))) \\ Charles R Greathouse IV, Feb 06 2017
  • Python
    def A004185(n):
        return int(''.join(sorted(str(n))).replace('0','')) if n > 0 else 0 # Chai Wah Wu, Nov 10 2015
    

A179239 Permutation classes of integers, each identified by its smallest member.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 44, 45, 46, 47, 48, 49, 50, 55, 56, 57, 58, 59, 60, 66, 67, 68, 69, 70, 77, 78, 79, 80, 88, 89, 90, 99, 100, 101, 102, 103
Offset: 0

Views

Author

Aaron Dunigan AtLee, Jul 04 2010

Keywords

Comments

Let the "permutation set" of a positive integer n be the set of all integers formed by permuting the digits of n. Two integers are "permutationally congruent" if they generate the same permutation set. A "permutation class" is a set of all permutationally congruent integers. This sequence lists each permutation class, identified by its smallest member.
These are also the positive integers in order, omitting any d-digit number n if a previously listed d-digit number is a permutation of the digits of n.
Range of A328447: smallest representative of the equivalence class of all numbers having the same digits up to permutation. Equivalently: Numbers with digits in nondecreasing order, except that the smallest nonzero digit must precede the zero digits. This sequence is useful when considering functions which depend only on the digits of n, e.g., the number of primes contained in n, cf. A039993, A039999, A075053 and the records therein, A072857 (primeval numbers) and A076497, resp. A239196 and A239197, etc. - M. F. Hasler, Oct 18 2019

Examples

			The permutation set of 24 is {24, 42}, and this is the equivalence class modulo permutations of both of them, so 24 is listed, but 42 is not.
The permutation set of 30 is {3, 30}, but 3 is not in the same permutation class as 30 since 30 cannot be obtained by permuting digits of 3. Therefore 30 is listed separately from 3.
The numbers 89 and 98 are also permutationally congruent and form a permutation class, so only the smaller one is listed.
		

Crossrefs

A variant of A009994.
Cf. A047726, A035927 (Number of distinct n-digit numbers up to permutations of digits).
Cf. A004186, A328447: largest & smallest representative of the class of n.

Programs

  • Mathematica
    maxTerm = 103; (*maxTerm is the greatest term you wish to see*) permutationSet[n_Integer] := FromDigits /@ Permutations[IntegerDigits[n]]; permutationCongruentQ[x_Integer, y_Integer] := Sort[permutationSet[x]] == Sort[permutationSet[y]]; DeleteDuplicates[Range[maxTerm], permutationCongruentQ]
    f[n_] := Block[{a = {0}, b = {DigitCount[0]}, i, w}, Do[w = DigitCount@ i; AppendTo[b, w]; If[! MemberQ[Most@ b, w], AppendTo[a, i]], {i, n}]; Rest@ a]; f@ 103 (* or faster: *)
    Select[Range@ 103, LessEqual @@ IntegerDigits@ # || And[Take[IntegerDigits@ #, Last@ DigitCount@ # + 1] == Reverse@ Take[Sort@ IntegerDigits@ #, Last@ DigitCount@ # + 1], LessEqual @@ DeleteCases[IntegerDigits@ #, d_ /; d == 0]] &] (* Michael De Vlieger, Jul 14 2015 *)
  • PARI
    is(n) = {my(d=digits(n),i); for(i=2,#d, if(d[i]!=0, d=vecextract(d,concat([1],vector(#d-i+1,j,i-1+j))); break));d==vecsort(d)||n/10^valuation(n,10)<10}
    \\given an element n, in base b, find the next element from the sequence.
    nxt(n,{b=10}) = {my(d = digits(n)); i = #d; while(i>0&&d[i]==b-1,i--); if(i>1, if(d[i]>0, d[i]++, d[i]=d[1];);for(j=i+1,#d,d[j]=d[i]), if(i==1, d[i]++;for(j=2,#d,d[j]=0), return(10^(#d))));sum(j=1,#d,d[j]*10^(#d-j))} \\ David A. Corneth, Apr 23 2016
    
  • PARI
    select( is_A179239(n)={n==A328447(n)}, [0..200]) \\ M. F. Hasler, Oct 18 2019
    
  • Python
    from itertools import count, chain, islice
    from sympy.utilities.iterables import combinations_with_replacement
    def A179239_gen(): # generator of terms
        return chain((0,),(int(a+''.join(b)) for l in count(1) for a in '123456789' for b in combinations_with_replacement('0'+''.join(str(d) for d in range(int(a),10)),l-1)))
    A179239_list = list(islice(A179239_gen(),31)) # Chai Wah Wu, Sep 13 2022

Extensions

Prefixed with a(0) = 0 by M. F. Hasler, Oct 18 2019

A036839 RATS(n): Reverse Add Then Sort the digits.

Original entry on oeis.org

0, 2, 4, 6, 8, 1, 12, 14, 16, 18, 11, 22, 33, 44, 55, 66, 77, 88, 99, 11, 22, 33, 44, 55, 66, 77, 88, 99, 11, 112, 33, 44, 55, 66, 77, 88, 99, 11, 112, 123, 44, 55, 66, 77, 88, 99, 11, 112, 123, 134, 55, 66, 77, 88, 99, 11, 112, 123, 134, 145, 66, 77
Offset: 0

Views

Author

N. J. A. Sloane, Jan 19 2002

Keywords

Comments

a(n) = RATS(n), not RATS(a(n-1)).
Row 10 of A288535. - Andrey Zabolotskiy, Jun 14 2017

Examples

			1 -> 1 + 1 = 2, so a(1) = 2; 3 -> 3 + 3 = 6, so a(3) = 6.
		

Crossrefs

Programs

  • Haskell
    a036839 = a004185 . a056964  -- Reinhard Zumkeller, Mar 14 2012
    
  • Maple
    read transforms; RATS := n -> digsort(n + digrev(n));
  • Mathematica
    FromDigits[Sort[IntegerDigits[#+FromDigits[Reverse [IntegerDigits[#]]]]]] & /@Range[0,80]  (* Harvey P. Dale, Mar 26 2011 *)
  • Python
    def A036839(n):
        x = str(n+int(str(n)[::-1]))
        return int("".join(sorted(x))) # Indranil Ghosh, Jan 28 2017

Formula

Form m by Reversing the digits of n, Add m to n Then Sort the digits of the sum into increasing order to get a(n).
a(n) = A004185(A056964(n)). [Reinhard Zumkeller, Mar 14 2012]

A028864 Primes with digits in nondecreasing order.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 47, 59, 67, 79, 89, 113, 127, 137, 139, 149, 157, 167, 179, 199, 223, 227, 229, 233, 239, 257, 269, 277, 337, 347, 349, 359, 367, 379, 389, 449, 457, 467, 479, 499, 557, 569, 577, 599, 677, 1117, 1123, 1129
Offset: 1

Views

Author

Keywords

Comments

Identical digits are acceptable, e.g., 1117 is in the sequence. - Harvey P. Dale, Aug 16 2011

Crossrefs

Programs

  • Magma
    [p:p in PrimesUpTo(1200)| Reverse(Intseq(p)) eq Sort(Intseq(p))]; // Marius A. Burtea, Nov 29 2019
    
  • Mathematica
    daoQ[n_] := Count[Differences[IntegerDigits[n]], ?(# < 0 &)] == 0; Select[Prime[Range[200]], daoQ] (* _Harvey P. Dale, Aug 16 2011 *)
    Select[Prime[Range[200]],Min[Differences[IntegerDigits[#]]]>-1&] (* Harvey P. Dale, Mar 02 2023 *)
  • PARI
    select(n->n=digits(n); n==vecsort(n), primes(500)) \\ Charles R Greathouse IV, Mar 15 2014
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy import isprime
    def A028864_gen(): # generator of terms
        yield from (2,3,5,7)
        a, b = {'1':0,'2':1,'3':1,'4':2,'5':2,'6':2,'7':2,'8':3,'9':3}, (1,3,7,9)
        for l in count(1):
            for d in combinations_with_replacement('123456789',l):
                k = 10*int(''.join(d))
                for e in b[a[d[-1]]:]:
                    if isprime(m:=k+e):
                        yield m
    A028864_list = list(islice(A028864_gen(),30)) # Chai Wah Wu, Dec 25 2023
  • R
    j=2; y=as.bigz(c()); while(j<1000) {
    x=sort(as.numeric(strsplit(as.character(j),spl="")[[1]]),decr=F)
    if(j==paste(x[x>0],collapse="")) y=c(y,j)
    j=nextprime(j)
    } //  Christian N. K. Anderson, Apr 04 2013
    

Formula

Trivially, a(n) >> exp(n^(1/10)). - Charles R Greathouse IV, Mar 15 2014
prime(n) = A028905(n) if prime(n) is in this sequence. - Alonso del Arte, Nov 25 2019

Extensions

Definition corrected by Omar E. Pol, Mar 22 2012

A179255 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nondecreasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 5, 8, 9, 10, 13, 15, 16, 22, 24, 26, 33, 36, 39, 50, 54, 58, 70, 77, 83, 100, 109, 116, 137, 150, 159, 186, 202, 216, 249, 270, 288, 328, 355, 379, 428, 462, 491, 554, 597, 633, 707, 760, 807, 899, 964, 1020, 1127, 1211, 1282, 1412, 1512, 1596, 1750, 1873, 1976, 2160, 2305, 2434, 2652, 2826, 2978
Offset: 0

Views

Author

Joerg Arndt, Jan 05 2011

Keywords

Comments

Partitions into distinct parts (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) <= p(k) - p(k-1) for all k >= 3.

Examples

			There are a(17) = 26 such partitions of 17:
01:  [ 1 2 3 4 7 ]
02:  [ 1 2 3 11 ]
03:  [ 1 2 4 10 ]  *
04:  [ 1 2 5 9 ]   *
05:  [ 1 2 14 ]   *
06:  [ 1 3 5 8 ]
07:  [ 1 3 13 ]   *
08:  [ 1 4 12 ]   *
09:  [ 1 5 11 ]   *
10:  [ 1 16 ]   *
11:  [ 2 3 4 8 ]
12:  [ 2 3 5 7 ]
13:  [ 2 3 12 ]   *
14:  [ 2 4 11 ]   *
15:  [ 2 5 10 ]   *
16:  [ 2 15 ]   *
17:  [ 3 4 10 ]   *
18:  [ 3 5 9 ]   *
19:  [ 3 14 ]   *
20:  [ 4 5 8 ]   *
21:  [ 4 13 ]   *
22:  [ 5 12 ]   *
23:  [ 6 11 ]   *
24:  [ 7 10 ]   *
25:  [ 8 9 ]   *
26:  [ 17 ]   *
The 21 partitions marked with * have strictly increasing differences, see the example for A179254.
- _Joerg Arndt_, Mar 31 2014
		

Crossrefs

Cf. A009994.
Cf. A179254 (strictly increasing differences), A179269, A007294.
Cf. A240026 (partitions with nondecreasing differences), A240027 (partitions with strictly increasing differences), A320382.

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0.reverse
      }
      cnt
    end
    def A179255(n)
      (0..n).map{|i| f(i)}
    end
    p A179255(50) # Seiichi Manyama, Oct 12 2018
  • Sage
    def A179255(n):
        has_nondecreasing_diffs = lambda x: min(differences(x,2)) >= 0
        allowed = lambda x: len(x) < 3 or has_nondecreasing_diffs(x)
        return len([x for x in Partitions(n,max_slope=-1) if allowed(x[::-1])])
    # D. S. McNeil, Jan 06 2011
    

A108662 Numbers whose sum of squares of digits is a prime.

Original entry on oeis.org

11, 12, 14, 16, 21, 23, 25, 27, 32, 38, 41, 45, 49, 52, 54, 56, 58, 61, 65, 72, 78, 83, 85, 87, 94, 101, 102, 104, 106, 110, 111, 113, 119, 120, 126, 131, 133, 137, 140, 146, 159, 160, 162, 164, 166, 168, 173, 179, 186, 191, 195, 197, 199, 201, 203, 205, 207, 210
Offset: 1

Views

Author

Zak Seidov, Jun 16 2005

Keywords

Comments

If m is in the sequence, then so are 10*m and any anagram (even with adding zeros between digits) of m. E.g., 12 is a term, hence 21, 102, 120, 201, 10020 all are here.
A sequence of primitive terms is of interest. It starts with 11, 12, 14, 16, 23, 25, 27, 38, 45, 49, 56, 58, 78, 111, 113, 119, 126, 133, 137, 146, 159, 166, 168, 179, 199. Note that digits are in nondecreasing order. - Zak Seidov, Dec 31 2013

Examples

			23 is in the sequence because 2^2 + 3^2 = 13 is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300],PrimeQ[Total[IntegerDigits[#]^2]]&] (* Harvey P. Dale, May 25 2012 *)
  • PARI
    isok(n) = isprime(norml2(digits(n))); \\ Michel Marcus, Jan 09 2019

A152054 Bouncy numbers (numbers whose digits are in neither increasing nor decreasing order).

Original entry on oeis.org

101, 102, 103, 104, 105, 106, 107, 108, 109, 120, 121, 130, 131, 132, 140, 141, 142, 143, 150, 151, 152, 153, 154, 160, 161, 162, 163, 164, 165, 170, 171, 172, 173, 174, 175, 176, 180, 181, 182, 183, 184, 185, 186, 187, 190, 191, 192, 193, 194, 195, 196
Offset: 1

Views

Author

Jerome Abela (Jerome.Abela(AT)gmail.com), Nov 22 2008

Keywords

Comments

Complement of union of A009994 and A009996. - Ray Chandler, Oct 25 2011
Number of n-digit bouncy numbers is 9*10^(n-1) - (n+18)*binomial(n+8, 8)/9 + 10. - Altug Alkan, Oct 02 2018

Crossrefs

Cf. A152464. - Jon E. Schoenfield, Dec 06 2008

Programs

  • Mathematica
    Select[Range[0,200], !LessEqual@@IntegerDigits[#] && !GreaterEqual@@IntegerDigits[#]&] (* Ray Chandler, Oct 25 2011 *)
    bnQ[n_]:=Module[{didn=Differences[IntegerDigits[n]]},Count[didn,?(#>0&)]>0 && Count[didn,?(#<0&)]>0]; Select[Range[100,200],bnQ] (* Harvey P. Dale, Jun 13 2020 *)
  • Python
    a = 1
    b = 100
    while a != 51:
        if str(b) != ''.join(sorted(str(b))) and str(b) != ''.join(sorted(str(b)))[::-1]:
            print(b)
            a += 1
        b += 1
    # David F. Marrs, Sep 25 2018
    
  • Python
    from itertools import count, islice
    def A152054_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            l = len(s:=tuple(int(d) for d in str(n)))
            for i in range(1,l-1):
                if (s[i-1]-s[i])*(s[i]-s[i+1]) < 0:
                    yield n
                    break
    A152054_list = list(islice(A152054_gen(),30)) # Chai Wah Wu, Jul 28 2023

Extensions

More terms from Jon E. Schoenfield, Dec 06 2008

A239016 Numbers not larger than any rotation of their digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 36, 37, 38, 39, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 66, 67, 68, 69, 77, 78, 79, 88, 89, 99, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 125, 126, 127, 128, 129, 132
Offset: 1

Views

Author

M. F. Hasler, Mar 08 2014

Keywords

Comments

The numbers with nonincreasing digits, A009994, form a subsequence which first differs at a(73)=132 (not in A009994) from this one.
This sequence is a subsequence of A072544: numbers whose smallest decimal digit is also the initial digit. A072544(65)=121 is the first such number not in this sequence.
This criterion involving "rotation" is part of the characterization of Lyndon words, see e.g. A102659, A102660, A210584, A210585. All of these are subsequences of this sequence. For example, A102659 = A213969 intersect A239016.

Examples

			The number 10 is excluded from this sequence because its "rotation" 01 is smaller than the number itself.
The same is the case for any number whose first digit is not the smallest one: rotating a smaller digit to the front will always yield a smaller number, independently of the other digits. For this reason, all terms must be in A072544.
a(73)=132 is in the sequence because the nontrivial rotations of its digits are 321 and 213, both larger than 132.
		

Programs

  • PARI
    is_A239016(n)=vecsort(d=digits(n))==d||!for(i=1,#d-1,n>[1,10^(#d-i)]*divrem(n,10^i)&&return)
    
  • Python
    def ok(n):
        s = str(n)
        if "".join(sorted(s)) == s: return True
        return all(n <= int(s[i:] + s[:i]) for i in range(1, len(s)))
    print(list(filter(ok, range(133)))) # Michael S. Branicky, Aug 21 2021

A261370 Permutation of nonnegative integers where a number having digits in nondescending order is followed by all numbers having the same digits arranged in increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 13, 31, 14, 41, 15, 51, 16, 61, 17, 71, 18, 81, 19, 91, 20, 22, 23, 32, 24, 42, 25, 52, 26, 62, 27, 72, 28, 82, 29, 92, 30, 33, 34, 43, 35, 53, 36, 63, 37, 73, 38, 83, 39, 93, 40, 44, 45, 54, 46, 64, 47, 74, 48, 84
Offset: 0

Views

Author

David A. Corneth, Aug 17 2015

Keywords

Comments

If a number contains a zero, then some permutation will yield a number with a leading zero, which is already in the sequence without the leading zero. So that permutation is not included. For example, 102 contains a zero, so 012 and 021 are permutations of these numbers' digits. But they are actually 12 and 21, which are already in the sequence. This leaves 120, 201 and 210 to be added to the sequence after 102.
From Rémy Sigrist, May 01 2017 : (Start)
- This sequence is to base 10 what A187769 is to base 2,
- Beyond the initial 0, this sequence can be seen as an irregular table, where the n-th row corresponds to the permutation class of A179239(n).
(End)

Crossrefs

Programs

  • Mathematica
    a = {0}; f[n_] := Block[{w = Sort@ Permutations@ IntegerDigits@ n}, w = Delete[w, Position[First /@ w, 0]]]; Do[If[! MemberQ[a, n], AppendTo[a, FromDigits /@ f@ n]], {n, 105}]; DeleteDuplicates@ Flatten@ a (* Michael De Vlieger, Sep 07 2015 *)
Showing 1-10 of 69 results. Next