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-8 of 8 results.

A010784 Numbers with distinct decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 102, 103, 104, 105, 106, 107, 108, 109, 120
Offset: 1

Views

Author

Keywords

Comments

More than the usual number of terms are displayed in order to show the difference from some closely related sequences.
Also: a(1) = 0; a(n) = Min{x integer | x > a(n-1) and all digits to base 10 are distinct}.
This sequence is finite: a(8877691) = 9876543210 is the last term; a(8877690) = 9876543201. The largest gap between two consecutive terms before a(249999) = 2409653 is 104691, as a(175289) = 1098765, a(175290) = 1203456. - Reinhard Zumkeller, Jun 23 2001
Complement of A109303. - David Wasserman, May 21 2008
For the analogs in other bases b, search for "xenodromes." A001339(b-1) is the number of base b xenodromes for b >= 2. - Rick L. Shepherd, Feb 16 2013
A073531 gives the number of positive n-digit numbers in this sequence. Note that it does not count 0. - T. D. Noe, Jul 09 2013
Can be seen as irregular table whose n-th row holds the n-digit terms; length of row n is then A073531(n) = 9*9!/(10-n)! except for n = 1 where we have 10 terms, unless 0 is considered to belong to a row 0. - M. F. Hasler, Dec 10 2018

Crossrefs

Subsequence of A043096.
Cf. A109303, A029740 (odds), A029741 (evens), A029743 (primes), A001339.

Programs

  • Haskell
    a010784 n = a010784_list !! (n-1)
    a010784_list = filter ((== 1) . a178788) [1..]
    -- Reinhard Zumkeller, Sep 29 2011
    
  • Mathematica
    Select[Range[0,100], Max[DigitCount[#]] == 1 &] (* Harvey P. Dale, Apr 04 2013 *)
  • PARI
    is(n)=my(v=vecsort(digits(n)));v==vecsort(v,,8) \\ Charles R Greathouse IV, Sep 17 2012
    
  • PARI
    select( is(n)=!n||#Set(digits(n))==logint(n,10)+1, [0..120]) \\ M. F. Hasler, Dec 10 2018
    
  • PARI
    apply( A010784_row(n,L=List(if(n>1,[])))={forvec(d=vector(n,i,[0,9]),forperm(d,p,p[1]&&listput(L,fromdigits(Vec(p)))),2);Set(L)}, [1..2]) \\ A010784_row(n) returns all terms with n digits. - M. F. Hasler, Dec 10 2018
    
  • Python
    A010784_list = [n for n in range(10**6) if len(set(str(n))) == len(str(n))] # Chai Wah Wu, Oct 13 2019
    
  • Python
    # alternate for generating full sequence
    from itertools import permutations
    afull = [0] + [int("".join(p)) for d in range(1, 11) for p in permutations("0123456789", d) if p[0] != "0"]
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022
    
  • Scala
    def hasDistinctDigits(n: Int): Boolean = {
      val numerStr = n.toString
      val digitSet = numerStr.split("").toSet
      numerStr.length == digitSet.size
    }
    (0 to 99).filter(hasDistinctDigits) // Alonso del Arte, Jan 09 2020

Formula

A178788(a(n)) = 1; A178787(a(n)) = n; A043537(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Jun 30 2010
A107846(a(n)) = 0. - Reinhard Zumkeller, Jul 09 2013

Extensions

Offset changed to 1 and first comment adjusted by Reinhard Zumkeller, Jun 14 2010

A073532 Number of n-digit primes with all digits distinct.

Original entry on oeis.org

4, 20, 97, 510, 2529, 10239, 33950, 90510, 145227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Zak Seidov, Aug 29 2002

Keywords

Comments

For any base b the number of distinct-digit primes is finite. For base 10, the maximal distinct-digit prime is 987654103; for any larger prime at least two digits coincide. The number of distinct-digit integers is also finite, see A073531.
No such primes exist with 10 or more distinct decimal digits, so a(n) = 0 for n >= 10. - Labos Elemer, Oct 25 2004; Robert G. Wilson v, Jul 25 2008

Examples

			a(3)=97 because there are 97 three-digit primes with distinct digits: 103, 107, 109, 127, 137, 139, 149, 157, 163, 167, 173, 179, 193, 197,239, 241, 251, 257, 263, 269, 271, 281, 283, 293,307, 317, 347, 349, 359, 367, 379, 389, 397, 401, 409, 419, 421, 431, 439, 457, 461, 463, 467, 479, 487, 491, 503, 509, 521, 523, 541, 547, 563, 569, 571, 587, 593, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 673, 683, 691, 701, 709, 719, 739, 743, 751, 761, 769, 809, 821, 823, 827, 829, 839, 853, 857, 859, 863, 907, 937, 941, 947, 953, 967, 971, 983.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[p = Prime@ n; If[ Union[Length /@ Split@ Sort@ IntegerDigits@ p] == {1}, AppendTo[lst, p]], {n, PrimePi[10^9]}]; Table[ Length@ Select[lst, 10^n < # < 10^(n + 1) &], {n, 0, 9}] (* Robert G. Wilson v, Jul 25 2008 *)
  • Python
    from itertools import permutations
    from sympy import isprime, primerange
    def distinct_digs(n): s = str(n); return len(s) == len(set(s))
    def a(n):
      if n >= 10: return 0
      return sum(isprime(int("".join(p))) for p in permutations("0123456789", n) if p[0] != '0')
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Apr 20 2021

Extensions

Edited by N. J. A. Sloane, Aug 14 2007
Entries checked by Robert G. Wilson v, Jul 25 2008

A036918 a(n) = floor(e*(n-1)*(n-1)!).

Original entry on oeis.org

0, 2, 10, 48, 260, 1630, 11742, 95900, 876808, 8877690, 98641010, 1193556232, 15624736140, 220048367318, 3317652307270, 53319412081140, 909984632851472, 16436597430879730, 313262209859119578, 6282647653285676000, 132266266384961600020, 2916471173788403280462
Offset: 1

Views

Author

Keywords

Comments

Also the number of positive integers with all distinct digits expressed in base n. E.g., a(10) = Sum_{j=1..10} A073531(j). - Labos Elemer, Dec 05 2002
For example, for n=3 we have 1, 2, 10, 12, 20, 21, 102, 120, 201, 210 (10 numbers in total). - Igor Krasikov, Aug 14 2023

Crossrefs

a(n) = A001339(n)-1.
Equals (n-1)*A000522(n-1).

Programs

  • Mathematica
    Table[Apply[Plus, Table[((b-1)/b)*Binomial[b, j]*j!, {j, 1, b}]], {b, 1, 25}]
    Table[Floor[E(n-1)(n-1)!],{n,25}] (* Harvey P. Dale, May 19 2025 *)

Formula

G.f.: Q(0)/(2*x) - 1/x - 1/(1-x), where Q(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + (1-x)/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 08 2013
a(n) = 2*(A038155(n) - A038155(n-1)). - Anton Zakharov, Oct 13 2016

A337127 Table with 10 columns read by rows: T(n, k) is the number of n-digit positive integers with exactly k distinct base 10 digits (0 < k <= 10).

Original entry on oeis.org

9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 81, 0, 0, 0, 0, 0, 0, 0, 0, 9, 243, 648, 0, 0, 0, 0, 0, 0, 0, 9, 567, 3888, 4536, 0, 0, 0, 0, 0, 0, 9, 1215, 16200, 45360, 27216, 0, 0, 0, 0, 0, 9, 2511, 58320, 294840, 408240, 136080, 0, 0, 0, 0, 9, 5103, 195048, 1587600, 3810240, 2857680, 544320, 0, 0, 0
Offset: 1

Views

Author

Stefano Spezia, Aug 17 2020

Keywords

Examples

			The table T(n, k) begins:
9     0      0       0       0       0  0  0  0  0
9    81      0       0       0       0  0  0  0  0
9   243    648       0       0       0  0  0  0  0
9   567   3888    4536       0       0  0  0  0  0
9  1215  16200   45360   27216       0  0  0  0  0
9  2511  58320  294840  408240  136080  0  0  0  0
...
		

Crossrefs

Cf. A010734, A048993, A052268 (row sums), A073531 (diagonal), A180599 (k = 1), A335843 (k = 2), A337313 (k = 3).

Programs

  • Mathematica
    T[n_,k_]:=9Pochhammer[11-k,k-1]/k!*n!*Coefficient[Series[(Exp[x]-1)^k,{x,0,n}],x,n]; Table[T[n,k],{n,7},{k,10}]//Flatten

Formula

T(n, k) = 9*Pochhammer(11-k, k-1)*n! * [x^n] (exp(x) - 1)^k/k!.
T(n, k) = 9*Pochhammer(11-k, k-1) * [x^n] x^k/Product_{j=1..k} (1-j*x).
T(n, k) = 9*Pochhammer(11-k, k-1)*S2(n, k) where S2(n, k) = A048993(n, k) are the Stirling numbers of the 2nd kind.

A117914 Decimal expansion of the sum of the reciprocals of all positive integers having distinct digits (there are exactly 8877690 such integers).

Original entry on oeis.org

8, 9, 2, 9, 9, 4, 8, 1, 7, 4, 7, 5, 5, 4, 4, 3, 4, 2, 4, 1, 7, 1, 1, 7, 9, 4, 0, 3, 9, 8, 1, 5, 2, 5, 0, 4, 8, 6, 6, 7, 2, 8, 6, 7, 6, 7, 2, 5, 5, 4, 0, 8, 4, 8, 0, 9, 3, 6, 9, 1, 3, 9, 9, 3, 0, 1, 8, 7, 6, 8, 1, 2, 0, 5, 5, 7, 2, 3, 9, 6, 5, 7, 4, 3, 7, 0, 6, 4, 1, 8, 1, 4, 1, 1, 2, 7, 3, 9, 5, 1, 7, 9, 2, 7, 1
Offset: 1

Views

Author

Eric W. Weisstein, Apr 01 2006

Keywords

Comments

Since there are only finitely many such numbers, the sum is rational.

Examples

			6745140117...4801548051 (14816583 digits)
----------------------------------------- = 8.9299481747554434241711794....
7553392231...8000000000 (14816582 digits)
		

Crossrefs

Cf. A073531.

A337314 a(n) is the number of n-digit positive integers with exactly four distinct base 10 digits.

Original entry on oeis.org

0, 0, 0, 4536, 45360, 294840, 1587600, 7715736, 35244720, 154700280, 661122000, 2773768536, 11487556080, 47136955320, 192126589200, 779279814936, 3149513947440, 12695388483960, 51073849285200, 205172877726936, 823325141746800, 3301203837670200, 13228529919066000
Offset: 1

Views

Author

Stefano Spezia, Sep 26 2020

Keywords

Comments

a(n) is the number of n-digit numbers in A031969.

Examples

			a(1) = a(2) = a(3) = 0 since the positive integers must have at least four digits;
a(4) = #{wxyz in N | w,x,y,z are four different digits with w != 0} = A073531(4) = 4536;
a(5) = 45360 since #[99999] - #[9999] - #(11111*[9]) - A335843(5) - A337313(5) - #{vwxyz in N | v,w,x,y,z are five different digits with v != 0} = 99999 - 9999 - 9 - 1215 - 16200 - 9*9*8*7*6 = 45360;
...
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{10,-35,50,-24},{0,0,0,4536},23]
  • PARI
    concat([0,0,0],Vec(4536*x^4/(1-10*x+35*x^2-50*x^3+24*x^4)+O(x^24)))

Formula

O.g.f.: 4536*x^4/(1 - 10*x + 35*x^2 - 50*x^3 + 24*x^4).
E.g.f.: 189*(exp(x) - 1)^4.
a(n) = 10*a(n-1) - 35*a(n-2) + 50*a(n-3) - 24*a(n-4) for n > 4.
a(n) = 4536*S2(n, 4) where S2(n, 4) = A000453(n).
a(n) = 189*(4^n - 4*3^n + 3*2^(n+1) - 4).
a(n) ~ 189 * 4^n.
a(n) = 189*(A000302(n) - 4*A000244(n) + 3*A000079(n+1) - 4).
a(n) = A337127(n, 4).

A344389 a(n) is the number of nonnegative numbers < 10^n with all digits distinct.

Original entry on oeis.org

1, 10, 91, 739, 5275, 32491, 168571, 712891, 2345851, 5611771, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691, 8877691
Offset: 0

Views

Author

Quan Tran, May 16 2021

Keywords

Comments

a(n) = a(10) for n > 10 by the pigeonhole principle.

Crossrefs

Cf. A073531.

Formula

a(0) = 1; a(n) = A073531(n) + a(n-1).

A378553 The number of n-digit composite numbers with all digits distinct.

Original entry on oeis.org

4, 61, 551, 4026, 24687, 125841, 510370, 1542450, 3120693, 3265920
Offset: 1

Views

Author

Shyam Sunder Gupta, Nov 30 2024

Keywords

Comments

This sequence is finite since there are no numbers at all which have 11 or more distinct decimal digits.
For n=10, the sum of 10 distinct digits is 0+1+..+9 = 45 which by "casting out 9s" shows such a number is divisible by 9 and so always composite.

Examples

			a(2) = 61 because there are 61 two-digit composite numbers with distinct digits: 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 26, 27, 28, 30, 32, 34, 35, 36, 38, 39, 40, 42, 45, 46, 48, 49, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 65, 68, 69, 70, 72, 74, 75, 76, 78, 80, 81, 82, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 98.
		

Crossrefs

Formula

a(n) <= A073531(n) with equality only for n = 10.
Showing 1-8 of 8 results.