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

A257128 a(n) = the smallest number k such that A227362(k) = A009995(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 12, 30, 13, 23, 40, 14, 24, 34, 50, 15, 25, 35, 45, 60, 16, 26, 36, 46, 56, 70, 17, 27, 37, 47, 57, 67, 80, 18, 28, 38, 48, 58, 68, 78, 90, 19, 29, 39, 49, 59, 69, 79, 89, 102, 103, 203, 123, 104, 204, 124, 304, 134, 234
Offset: 1

Views

Author

Jaroslav Krizek, Apr 16 2015

Keywords

Comments

A227362(n) = reverse concatenation of distinct digits of n in base 10, A009995(n) = possible values of A227362(m) in increasing order.
Finite sequence with 1023 terms.

Examples

			a(15) = 13 because 13 is the smallest number k such that reverse concatenation of distinct digits of k (i.e., 31) in base 10 = A227362(k) = A227362(13) = A009995(15) = 31.
		

Crossrefs

Programs

  • Magma
    A257128:=func; [A257128(n): n in[A009995(n)]]
  • Mathematica
    f[n_] := Block[{s = Sort@ Flatten@ Table[FromDigits /@ Subsets[Range[9, 0, -1], {j}], {j, 10}], i, k}, Reap@For[i = 1, i <= n, i++, k = 0; While[FromDigits[Reverse@ Union@ IntegerDigits@ k] != s[[i]], k++]; Sow@ k] // Flatten // Rest]; f@ 65 (* Michael De Vlieger, Apr 16 2015, after Zak Seidov at A009995, corrected by Robert G. Wilson v *)

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

A009995 Numbers with digits in strictly decreasing order. From the Macaulay expansion of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 210, 310, 320, 321, 410, 420, 421, 430, 431, 432, 510, 520, 521, 530
Offset: 1

Views

Author

Keywords

Comments

There are precisely 1023 terms (corresponding to every nonempty subset of {0..9}).
A178788(a(n)) = 1. - Reinhard Zumkeller, Jun 30 2010
A193581(a(n)) > 0 for n > 9. - Reinhard Zumkeller, Aug 10 2011
A227362(a(n)) = a(n). - Reinhard Zumkeller, Jul 09 2013
For a fixed natural number r, any natural number n has a unique "Macaulay expansion" n = C(a_r,r)+C(a_{r-1},r-1)+...+C(a_1,1) with a_r > a_{r-1} > ... > a_1 >= 0. If r=10, concatenating the digits a_r, ..., a_1 gives the present sequence. The representation is valid for all n, but the concatenation only makes sense if all the a_i are < 10. - N. J. A. Sloane, Apr 05 2014
a(n) = A262557(A263327(n)); a(A263328(n)) = A262557(n). - Reinhard Zumkeller, Oct 15 2015

Crossrefs

Cf. A009993.
Cf. A262557 (sorted lexicographically), A263327, A263328.

Programs

  • Haskell
    import Data.Set (fromList, minView, insert)
    a009995 n = a009995_list !! n
    a009995_list = 0 : f (fromList [1..9]) where
       f s = case minView s of
             Nothing     -> []
             Just (m,s') -> m : f (foldl (flip insert) s' $
                                  map (10*m +) [0..m `mod` 10 - 1])
    -- Reinhard Zumkeller, Aug 10 2011
    
  • Mathematica
    Sort@ Flatten@ Table[FromDigits /@ Subsets[ Range[9, 0, -1], {n}], {n, 10}] (* Zak Seidov, May 10 2006 *)
  • PARI
    is(n)=fromdigits(vecsort(digits(n),,12))==n \\ Charles R Greathouse IV, Apr 16 2015

A109303 Numbers k with at least one duplicate base-10 digit (A107846(k) > 0).

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 101, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166, 171, 177, 181, 188, 191, 199, 200, 202, 211, 212, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 232, 233, 242
Offset: 1

Views

Author

Rick L. Shepherd, Jun 24 2005

Keywords

Comments

Complement of A010784, numbers with distinct base-10 digits, so all numbers greater than 9876543210 (last term of A010784) are terms. a(263)=1001 is the first term not also a term of A044959; a(264)=1002 is the first term not also a term of A084050. The terms of A044959 greater than 9 are a subsequence. The terms of A084050 greater than 90 are a subsequence.
A178788(a(n)) = 0; A178787(a(n)) = A178787(a(n)-1); A043537(a(n)) < A109303(a(n)). - Reinhard Zumkeller, Jun 30 2010
A227362(a(n)) < a(n). - Reinhard Zumkeller, Jul 09 2013

Crossrefs

Cf. A010784 (numbers with distinct digits), A044959 (numbers with no two equally numerous digits), A084050 (numbers with a palindromic permutation of digits), A107846 (number of duplicate digits of n). Also see A062813, which gives the largest number in each base containing all distinct digits.

Programs

  • Haskell
    a109303 n = a109303_list !! (n-1)
    a109303_list = filter ((> 0) . a107846) [0..]
    -- Reinhard Zumkeller, Jul 09 2013
    
  • Mathematica
    Select[Range[300], Max[DigitCount[#]] > 1 &] (* Harvey P. Dale, Jan 14 2011 *)
  • Python
    def ok(n): s = str(n); return len(set(s)) < len(s)
    print([k for k in range(243) if ok(k)]) # Michael S. Branicky, Nov 22 2021

A358497 Replace each new digit in n with index 1, 2, ..., 9, 0 in order in which that digit appears in n, from left to right.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 12
Offset: 0

Views

Author

Gleb Ivanov, Nov 19 2022

Keywords

Comments

a(n) gives the canonical form which enumerates digits in order of their first occurrence in n, from left to right. a(n) uniquely defines the pattern of identical digits in n. - Dmytro Inosov, Jul 16 2024

Examples

			n = 10 has 2 different digits; replace first encountered digit 1 -> 1, replace second digit 0 -> 2, therefore a(10) = 12.
n = 141 has 3 digits, but only 2 different ones; replace first encountered digit 1 -> 1, replace second encountered digit 4 -> 2, therefore a(141) = 121.
		

Crossrefs

Cf. A071159, A227362, A358615 (record high values).

Programs

  • Mathematica
    A358497[k_] := With[{pI = Values@PositionIndex@IntegerDigits@k}, MapIndexed[#1 -> Mod[#2[[1]], 10] &, pI, {2}] // Flatten // SparseArray // FromDigits]; (* Dmytro Inosov, Jul 15 2024 *)
  • PARI
    a(n) = {if(n == 0, return(1)); my(d = digits(n), m = Map(), t = 0); for(i = 1, #d, if(mapisdefined(m, d[i]), d[i] = mapget(m, d[i]) , t++; if(t == 10, t = 0); mapput(m, d[i], t); d[i] = t ) ); fromdigits(d) } \\ David A. Corneth, Nov 23 2022
  • Python
    def A358497(n):
        d,s,k = dict(),str(n),1
        for i in range(len(s)):
            if d.get(s[i],0) == 0:
                d[s[i]] = str(k)
                k = (k + 1)%10
        s_t = list(s)
        for i in range(len(s)):s_t[i] = d[s[i]]
        return int(''.join(s_t))
    print([A358497(i) for i in range(100)])
    
  • Python
    def A358497(n):
        s, c, i  = str(n), {}, 49
        for d in map(ord,s):
            if d not in c:
                c[d] = i
                i += 1
        return int(s.translate(c)) # Chai Wah Wu, Jul 09 2024
    

Formula

a(a(n)) = a(n). - Dmytro Inosov, Jul 16 2024

A052983 Least multiple of n consisting of a succession of 1's followed by a succession of 0's.

Original entry on oeis.org

10, 10, 1110, 100, 10, 1110, 1111110, 1000, 1111111110, 10, 110, 11100, 1111110, 1111110, 1110, 10000, 11111111111111110, 1111111110, 1111111111111111110, 100, 1111110, 110, 11111111111111111111110, 111000, 100, 1111110, 1111111111111111111111111110
Offset: 1

Views

Author

Lekraj Beedassy, Jun 26 2003

Keywords

Comments

All entries are differences of two terms of A000042. Since the pigeonhole principle guarantees that, for any m, two among the first m+1 entries of A000042 are congruent modulo m, their difference (i.e. belonging to this sequence) is therefore divisible by m, so that such numbers exist for all m. This sequence is thus infinite.
For n>1, a(n) consists of s 1's and t 0's, where s=A084681(X) and t is the greater of p or q (s=1 for X=1, t=1 for p=q=0), when we write n=X*Y with (X,Y)=1 and Y=2^p*5^q.

Examples

			We have a(6)=1110 because 6 divides 1110=6*185, the smallest such one with a string of 1's followed by that of 0's
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Select[ Map[ FromDigits, IntegerDigits[ Table[ Sum[2^i, {i, k, j, -1}], {j, k, 1, -1}], 2]]/n, IntegerQ[ # ] & ]; g[n_] := Block[{k = 1}, While[ f[n] == {}, k++ ]; n*Min[ f[n]]]; Table[ g[n], {n, 1, 27}]
    nn=30;With[{nos=Sort[Flatten[Table[FromDigits[Join[Table[1,{n}], Table[ 0,{i}]]],{n,nn},{i,5}]]]},Flatten[Table[Select[nos,Divisible[#,n]&,1],{n,nn}]]] (* Harvey P. Dale, Mar 09 2014 *)

Formula

a(n) = A276348(n) * n; A227362(a(n)) = 10. - Jaroslav Krizek, Aug 30 2016

Extensions

Edited, corrected and extended by Robert G. Wilson v, Jun 26 2003

A180410 Unique digits used in n in numerical order.

Original entry on oeis.org

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

Views

Author

Dominick Cancilla, Sep 02 2010

Keywords

Comments

a(n) = A227362(n) - A151949(n). - Reinhard Zumkeller, Jul 09 2013

Examples

			a(93077) = 0379 = 379. Seven is only used once and the digits are sorted. The initial zero is not shown.
		

Crossrefs

This is identical to A180409 with the zeros removed.

Programs

  • Haskell
    import Data.List (nub, sort)
    a180410 = read . sort . nub . show :: Integer -> Integer
    -- Reinhard Zumkeller, Jul 09 2013
  • Maple
    a:= n-> parse(cat(sort([{convert(n, base, 10)[]}[]])[])):
    seq(a(n), n=1..70);  # Alois P. Heinz, Sep 21 2022

Formula

a(n) = 0123456789 after any digits not appearing in n are removed.

A230959 If n is pandigital then 0 else (digits not occurring in decimal representation of n, arranged in decreasing order).

Original entry on oeis.org

987654321, 987654320, 987654310, 987654210, 987653210, 987643210, 987543210, 986543210, 976543210, 876543210, 98765432, 987654320, 98765430, 98765420, 98765320, 98764320, 98754320, 98654320, 97654320, 87654320, 98765431, 98765430, 987654310, 98765410
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 02 2013

Keywords

Comments

a(0) > a(n) for n > 0;
a(A171102(n)) = 0 by definition, but also a(A050289(n)) = 0.

Crossrefs

Cf. A227362.

Programs

  • Haskell
    import Data.List ((\\))
    a230959 n = (if null cds then 0 else read cds) :: Integer
       where cds = "9876543210" \\ show n
    
  • Mathematica
    pd[n_]:=Module[{idn=Sort[IntegerDigits[n]]},If[idn==Range[0,9],0,FromDigits[ Reverse[ Complement[ Range[ 0,9],idn]]]]]; Table[pd[n],{n,0,30}] (* Harvey P. Dale, Nov 16 2023 *)
  • Python
    def A230959(n): return int(''.join(sorted(set('9876543210')-set(str(n)),reverse=True)) or 0) # Chai Wah Wu, Nov 23 2022

A254323 Remove in decimal representation of A254143(n) all repeated digits.

Original entry on oeis.org

1, 4, 7, 16, 28, 34, 37, 49, 67, 136, 148, 238, 259, 268, 34, 37, 367, 469, 67, 156, 1258, 136, 1348, 1369, 1468, 278, 238, 2359, 2479, 2569, 268, 34, 37, 367, 367, 489, 469, 67, 1356, 1458, 12358, 12469, 12478, 136, 1348, 13468, 13579, 1468, 2378, 2579
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 28 2015

Keywords

Comments

a(n) <= 123456789 for all n, and a(n) < 123456789 for n < 396;
a(396) = 123456789 = A050289(1);

Crossrefs

Cf. A254338 (initial digits), A254339 (final digits).

Programs

  • Haskell
    a254323 = a137564 . a254143

A276349 Numbers consisting of a nonempty string of 1's followed by a nonempty string of 0's.

Original entry on oeis.org

10, 100, 110, 1000, 1100, 1110, 10000, 11000, 11100, 11110, 100000, 110000, 111000, 111100, 111110, 1000000, 1100000, 1110000, 1111000, 1111100, 1111110, 10000000, 11000000, 11100000, 11110000, 11111000, 11111100, 11111110, 100000000, 110000000, 111000000
Offset: 1

Views

Author

Jaroslav Krizek, Aug 30 2016

Keywords

Comments

Intersection of A037415 and A009996 except for 1 [Corrected by David A. Corneth, Aug 30 2016].
Set of terms from sequence A052983.
a(n) is the binary expansion of A043569(n). - Michel Marcus, Sep 04 2016

Examples

			60 is of the form binomial(a, 2) + b where 0 < b <= a and a = 11, b = 5. So a(60) has (11 + 1) digits and 5 leading ones. The other digits are 0. Giving a(60) = 111110000000. It has 7 (more than 1) trailing zeros so the next one, a(61) is a(60) + 10^(7 - 1). - _David A. Corneth_, Aug 30 2016
		

Crossrefs

Programs

  • Magma
    [n: n in [1..10^7] | Seqint(Setseq(Set(Sort(Intseq(n))))) eq 10 and Seqint(Sort((Intseq(n)))) eq n];
    
  • Maple
    seq(seq(10^(m+1)*(1-10^(-j))/9,j=1..m),m=1..20); # Robert Israel, Sep 02 2016
  • Mathematica
    Table[FromDigits@ Join[ConstantArray[1, #1], ConstantArray[0, #2]] & @@@ Transpose@ {#, n - #} &@ Range[n - 1], {n, 2, 9}] // Flatten (* Michael De Vlieger, Aug 30 2016 *)
    Flatten[Table[FromDigits[Join[PadRight[{},n,1],PadRight[{},k,0]]],{n,8},{k,8}]]//Sort (* Harvey P. Dale, Jan 09 2019 *)
  • PARI
    is(n) = vecmin(digits(n))==0 && vecmax(digits(n))==1 && digits(n)==vecsort(digits(n), , 4) \\ Felix Fröhlich, Aug 30 2016
    
  • PARI
    a(n) = my(r =  ceil((sqrt(1+8*n)+1)/2), k = n - binomial(r-1, 2));10^(r-k)*(10^(k)-1)/9
    \\ given an element n, computes the next element of the sequence.
    nxt(n) = my(d = digits(n), qd=#d, s = vecsum(d)); if(qd-s>1, n+10^(qd-s-1), 10^qd)
    \\ given an element n of the sequence, computes its place in the sequence.
    inv(n) = my(d = digits(n)); binomial(#d-1,2) + vecsum(d) \\ David A. Corneth, Aug 31 2016
    
  • Python
    from math import isqrt, comb
    def A276349(n): return 10*(10**(m:=isqrt(n<<3)+1>>1)-10**(comb(m+1,2)-n))//9 # Chai Wah Wu, Jun 16 2025

Formula

A227362(a(n)) = 10.
From Robert Israel, Sep 02 2016: (Start)
a((m^2-m)/2+j) = 10^(m+1)*(1-10^(-j))/9 for m>=1, 1<=j<=m.
a(n) = 10*(10^m - 10^(-n+m*(m+1)/2))/9 where m = A002024(n). (End)
A002275(A002260(n)) * 10^A004736(n) - Peter Kagey, Sep 02 2016
Sum_{n>=1} 1/a(n) = A073668. - Amiram Eldar, Feb 20 2022
a(n) = 10*A309761(n). - Chai Wah Wu, Jun 16 2025
Showing 1-10 of 11 results. Next