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

A004086 Read n backwards (referred to as R(n) in many sequences).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 3, 13, 23, 33, 43, 53, 63, 73, 83, 93, 4, 14, 24, 34, 44, 54, 64, 74, 84, 94, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 6, 16, 26, 36, 46, 56, 66, 76, 86, 96, 7, 17, 27, 37, 47
Offset: 0

Views

Author

Keywords

Comments

Also called digit reversal of n.
Leading zeros (after the reversal has taken place) are omitted. - N. J. A. Sloane, Jan 23 2017

Crossrefs

Programs

  • Haskell
    a004086 = read . reverse . show  -- Reinhard Zumkeller, Apr 11 2011
    
  • J
    |.&.": i.@- 1e5 NB. Stephen Makdisi, May 14 2018
  • Maple
    read transforms; A004086 := digrev; #cf "Transforms" link at bottom of page
    A004086:=proc(n) local s,t; if n<10 then n else s:=irem(n,10,'t'); while t>9 do s:=s*10+irem(t,10,'t') od: s*10+t fi end; # M. F. Hasler, Jan 29 2012
  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n]]], {n, 0, 75}]
    IntegerReverse[Range[0,80]](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 13 2018 *)
  • PARI
    dig(n) = {local(m=n,r=[]); while(m>0,r=concat(m%10,r);m=floor(m/10));r}
    A004086(n) = {local(b,m,r);r=0;b=1;m=dig(n);for(i=1,matsize(m)[2],r=r+b*m[i];b=b*10);r} \\ Michael B. Porter, Oct 16 2009
    
  • PARI
    A004086(n)=fromdigits(Vecrev(digits(n))) \\ M. F. Hasler, Nov 11 2010, updated May 11 2015, Sep 13 2019
    
  • Python
    def A004086(n):
        return int(str(n)[::-1]) # Chai Wah Wu, Aug 30 2014
    

Formula

For n > 0, a(a(n)) = n iff n mod 10 != 0. - Reinhard Zumkeller, Mar 10 2002
a(n) = d(n,0) with d(n,r) = r if n=0, otherwise d(floor(n/10), r*10+(n mod 10)). - Reinhard Zumkeller, Mar 04 2010
a(10*n+x) = x*10^m + a(n) if 10^(m-1) <= n < 10^m and 0 <= x <= 9. - Robert Israel, Jun 11 2015

Extensions

Extended by Ray Chandler, Dec 30 2004

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
    

A004186 Arrange digits of n in decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 21, 31, 41, 51, 61, 71, 81, 91, 20, 21, 22, 32, 42, 52, 62, 72, 82, 92, 30, 31, 32, 33, 43, 53, 63, 73, 83, 93, 40, 41, 42, 43, 44, 54, 64, 74, 84, 94, 50, 51, 52, 53, 54, 55, 65, 75, 85, 95, 60, 61, 62, 63, 64, 65, 66, 76, 86, 96, 70, 71, 72
Offset: 0

Views

Author

Keywords

Comments

a(A009996(n)) = A009996(n). - Reinhard Zumkeller, Oct 31 2007
If we define "sortable primes" as prime numbers that remain prime when their digits are sorted in decreasing order, then all absolute primes (A003459) are sortable primes but not all sortable primes are absolute primes. For example, 113 is both sortable and absolute, and 313 is sortable but not absolute since its digits can be permuted to 133 = 7 * 19. - Alonso del Arte, Oct 05 2013

Examples

			a(19) = 91 because the digits of 19 being 1 and 9, arranged in decreasing order they are 9 and 1.
a(20) = 20 because the digits are already in decreasing order.
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort)
    a004186 = read . reverse . sort . show :: Integer -> Integer
    -- Reinhard Zumkeller, Aug 19 2011
    
  • Maple
    A004186 := proc(n)
        local dgs;
        convert(n,base,10) ;
        dgs := sort(%) ;
        add( op(i,dgs)*10^(i-1),i=1..nops(dgs)) ;
    end proc:
    seq(A004186(n),n=0..20) ; # R. J. Mathar, Jul 26 2015
  • Mathematica
    sortDigitsDown[n_] := FromDigits@ Reverse@ Sort@ IntegerDigits@ n; Array[sortDigitsDown, 73, 0] (* Robert G. Wilson v, Aug 19 2011 *)
  • PARI
    reconstruct(m) = {local(r); r=0; for(i=1,matsize(m)[2],r=r*10+m[i]); r}
    A004186(n) = reconstruct(vecsort(digits(n),,4))
    \\ Michael B. Porter, Nov 11 2009
    
  • PARI
    a(n) = fromdigits(vecsort(digits(n), , 4)); \\ Joerg Arndt, Feb 24 2019
    
  • Python
    def a(n): return int("".join(sorted(str(n), reverse=True)))
    print([a(n) for n in range(73)]) # Michael S. Branicky, Feb 21 2021

Formula

n <= a(n) < 10n. - Charles R Greathouse IV, Aug 07 2024

Extensions

More terms from Reinhard Zumkeller, Oct 31 2007

A372034 For a positive number k, let L(k) denote the list consisting of k followed by the prime factors of k, with repetition, in nondecreasing order; sequence gives composite k such that the digits of L(k) are in nonincreasing order.

Original entry on oeis.org

4, 8, 9, 22, 32, 33, 44, 55, 64, 77, 88, 93, 99, 422, 633, 775, 844, 933, 993, 4222, 4442, 6333, 6655, 6663, 7533, 7744, 7775, 8444, 8884, 9663, 9993, 44222, 66333, 88444, 99633, 99933, 99993, 933333, 966333, 996663, 999993, 4442222, 6663333, 7777775, 8884444, 9663333, 9666633, 9666663
Offset: 1

Views

Author

Scott R. Shannon, Apr 16 2024

Keywords

Comments

Is it true that no terms end with 1? A separate search on those shows none with < 70 digits. Michael S. Branicky, Apr 23 2024
Testing all products of repunit primes (A004022, A004023), there are no terms ending in 1 less than 10^3000. - Michael S. Branicky, Apr 24 2024

Examples

			The initial terms and their factorizations are:
4 = [2, 2]
8 = [2, 2, 2]
9 = [3, 3]
22 = [2, 11]
32 = [2, 2, 2, 2, 2]
33 = [3, 11]
44 = [2, 2, 11]
55 = [5, 11]
64 = [2, 2, 2, 2, 2, 2]
77 = [7, 11]
88 = [2, 2, 2, 11]
93 = [3, 31]
99 = [3, 3, 11]
422 = [2, 211]
633 = [3, 211]
775 = [5, 5, 31]
844 = [2, 2, 211]
933 = [3, 311]
993 = [3, 331]
4222 = [2, 2111]
4442 = [2, 2221]
6333 = [3, 2111]
6655 = [5, 11, 11, 11]
6663 = [3, 2221]
7533 = [3, 3, 3, 3, 3, 31]
7744 = [2, 2, 2, 2, 2, 2, 11, 11]
...
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    def ni(s): return sorted(s, reverse=True) == list(s)
    def ok(n):
        if n < 4 or isprime(n): return False
        s, f = str(n), "".join(str(p)*e for p, e in factorint(n).items())
        return ni(s+f)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Apr 23 2024
    
  • Python
    # faster for initial segment of sequence
    from sympy import factorint, isprime
    from itertools import islice, combinations_with_replacement as mc
    def ni(s): return s == "".join(sorted(s, reverse=True))
    def bgen(d):
        yield from ("".join(m) for m in mc("987654321", d))
    def agen(): # generator of terms
        for d in range(1, 70):
            out = set()
            for s in bgen(d):
                t = int(s)
                if t < 4 or isprime(t): continue
                if ni(s+"".join(str(p)*e for p, e in factorint(t).items())):
                    out.add(t)
            yield from sorted(out)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Apr 23 2024

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

A028822 Squares with digits in nonincreasing order.

Original entry on oeis.org

0, 1, 4, 9, 64, 81, 100, 400, 441, 841, 900, 961, 6400, 7744, 8100, 10000, 40000, 44100, 84100, 90000, 96100, 640000, 774400, 810000, 1000000, 4000000, 4410000, 8410000, 8874441, 9000000, 9610000, 9853321, 64000000, 77440000
Offset: 1

Views

Author

Keywords

Comments

From Robert G. Wilson v, Jan 02 2014: (Start)
If x is present so is 100x. The primitives are 0, 1, 4, 9, 64, 81, 441, 841, 961, 7744, 8874441, 9853321, 999887641, …, . = A062826. Their square roots are: 0, 1, 2, 3, 8, 9, 21, 29, 31, 88, 2979, 3139, 31621, …, . Are there no more primitives?
Number of terms less than 10^k, beginning with k=0: 1, 4, 6, 12, 15, 21, 24, 32, 35, 44, 47, 56, 59, 68, 71, 80, 83, 92, 95, …, .
Like all squares the ending digits can be 0, 1, 4, 5, 6 or 9. Here is the tally of the list of terms < 10^18: {0, 84}, {1, 8}, {4, 3}, {5, 0}, {6, 0}, {9, 1}. (End)

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Max[ Differences[ IntegerDigits[ n]]] < 1; Select[ Range[0, 9000]^2, fQ] (* Robert G. Wilson v, Jan 02 2014 *)
    Select[Range[0,10^4]^2,GreaterEqual@@IntegerDigits[#]&] (* Ray Chandler, Jan 05 2014 *)
  • PARI
    isA009996(n)=n=digits(n); for(i=2,#n,if(n[i]>n[i-1],return(0))); 1
    is(n)=issquare(n) && isA009996(n) \\ Charles R Greathouse IV, Jan 02 2014

Formula

For n > 1, a(n) = A062826(i) * 10^j for some i and j. - Charles R Greathouse IV, Jan 02 2014
a(n) = A028821(n)^2. - Ray Chandler, Jan 05 2014

Extensions

Better name from Robert G. Wilson v, Jan 02 2014

A032907 Numbers whose base-10 representation Sum_{i=0..m} d(i)*10^i has d(0) <= d(1) >= d(2) <= ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 110, 111, 120
Offset: 1

Views

Author

Keywords

Crossrefs

Differs from A032873 and A009996.

Programs

  • PARI
    is(n)=my(d=digits(n));r=1;forstep(i=#d,2,-1,if((-1)^(#d-i)*d[i]>(-1)^(#d-i)*d[i-1],r=0;break));r \\ David A. Corneth, Feb 01 2015

A032873 Numbers whose base-10 representation Sum_{i=0..m} d(i)*10^i has d(m) >= d(m-1) <= d(m-2) >= ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 112
Offset: 1

Views

Author

Keywords

Crossrefs

Contains 100 so differs from A032907, contains 101 so differs from A009996.

A072543 Numbers whose largest decimal digit is also the initial digit.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 110, 111, 200, 201
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 04 2002

Keywords

Comments

A054055(a(n)) = A000030(a(n));
the sequence differs from A009996, A032873 and A032907: a(66)=101 is not in A009996, a(67)=110 is not in A032873 and a(65)=100 is not in A032907.

Examples

			a(10^ 1) = 9
a(10^ 2) = 411
a(10^ 3) = 6216
a(10^ 4) = 73474
a(10^ 5) = 813826
a(10^ 6) = 8512170
a(10^ 7) = 88368780
a(10^ 8) = 911960211
a(10^ 9) = 9237655227
a(10^10) = 93323313303
		

Crossrefs

Cf. A072544.

Programs

  • Haskell
    a072543 n = a072543_list !! (n-1)
    a072543_list = [x | x <- [0..], a054055 x == a000030 x]
    -- Reinhard Zumkeller, Apr 25 2012
    
  • Maple
    for i from 1 to 10 do A[i]:= i-1 od:
    count:= 10:
    for i from 1 to 9 do P[i]:= [seq([j],j=0..i)]; od:
    for d from 2 to 4 do
      for x from 1 to 9 do
        for p in P[x] do
          count:= count+1;
          A[count]:= add(p[k]*10^(k-1),k=1..d-1) + x*10^(d-1);
        od:
        P[x]:= [seq(seq([op(v),t], v=P[x]),t=0..x)];
      od
    od:
    seq(A[i],i=1..count); # Robert Israel, Feb 01 2015
  • Mathematica
    Select[Range[0,250],Max[IntegerDigits[#]]==First[IntegerDigits[#]]&] (* Harvey P. Dale, Apr 28 2016 *)
  • PARI
    is(n)=n=digits(n); !#n || n[1]==vecmax(n) \\ Charles R Greathouse IV, Jan 02 2014
    
  • PARI
    a(n)={d = 0; r = 1; s = 0; i = 0; if(n == 1, 0, n-=2; while(n > sum(i=0, 9,(i+1)^d), n-=sum(i=0, 9, (i+1)^d); n++; d++); while(n >= (r+1)^d, n -= (r+1)^d; r++);s = r * 10^d; while(n, s += 10^i*(n%(r+1)); n \= (r+1); i++));s } \\ David A. Corneth, Jan 31 2015

Extensions

Offset corrected by Reinhard Zumkeller, Apr 25 2012
Showing 1-10 of 30 results. Next