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

A098225 Duplicate of A073532.

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
Offset: 1

Views

Author

Keywords

A074667 Seven-digit distinct-digit primes.

Original entry on oeis.org

1023467, 1023487, 1023697, 1023769, 1023857, 1023947, 1024357, 1024379, 1024579, 1024589, 1024693, 1024697, 1024783, 1024853, 1024957, 1024963, 1024987, 1025347, 1025483, 1025693, 1025749, 1025789, 1025839, 1025873, 1025897, 1026359, 1026439
Offset: 1

Views

Author

Zak Seidov, Aug 30 2002

Keywords

Comments

The last term is a(33950) = 9876413. - Giovanni Resta, Mar 19 2013
There are 33,950 terms in the sequence. - Harvey P. Dale, Jun 01 2024

Examples

			a(1)=1023467 because it is the first (smallest) 7-digit prime with all distinct digits.
		

Crossrefs

The first differences are in A074668.
Cf. A073532 (Number of n-digit primes with all digits distinct). - Jon E. Schoenfield, Aug 13 2017

Programs

  • Maple
    lim:=pi(1026439): for n from pi(1000000) to lim do p:=ithprime(n): d:=[op(convert(p, base, 10))]: ddig:=true: for k from 0 to 9 do if(numboccur(k, d)>1)then ddig:=false: break: fi: od: if(ddig)then printf("%d, ", p): fi: od: # Nathaniel Johnston, Jun 22 2011
  • Mathematica
    Select[Range[1023457, 9876543, 2], Length[Union[IntegerDigits[ # ]]]==7 &&PrimeQ[ # ]&]
    Select[FromDigits/@Permutations[Range[0,9],{7}],IntegerLength[#]==7&&PrimeQ[#]&] (* Harvey P. Dale, Jun 01 2024 *)
  • PARI
    is(n)=isprime(n) && #digits(n)==7 && #Set(digits(n))==7 \\ Charles R Greathouse IV, Feb 11 2017

A073531 Number of n-digit positive integers with all digits distinct.

Original entry on oeis.org

9, 81, 648, 4536, 27216, 136080, 544320, 1632960, 3265920, 3265920
Offset: 1

Views

Author

Zak Seidov, Aug 29 2002

Keywords

Comments

For any base b the number of distinct-digit numbers is finite. For base 10, the maximal distinct-digit number is 9876543210; for any larger number at least two digits coincide. The number of distinct-digit primes is also finite, see A073532.
If "positive" is replaced by "nonnegative" we get the sequence 10, 81, 648, 4536, 27216, 136080, 544320, 1632960, 3265920, 3265920.
Alternatively, if 0 is considered to have 0 digits, one could prefix a(0) = 1. This would be compatible with the given formula and 9/10 rounded to the nearest integer. - M. F. Hasler, Dec 10 2018
a(10) is the final term because no number having more than 10 digits can have all digits distinct. - Jon E. Schoenfield, May 17 2021

Examples

			a(3) = 648 because there are 648 three-digit integers with distinct digits.
		

Crossrefs

Cf. A073532.
Cf. A010784 for the list of these integers.

Programs

  • GAP
    List([1..10],n->9*Factorial(9)/(Factorial(10-n))); # Muniru A Asiru, Dec 11 2018
    
  • Magma
    [9*Factorial(9)/Factorial(10-n): n in [1..10]]; // Vincenzo Librandi, Dec 13 2018
  • Maple
    seq(9*factorial(9)/(factorial(10-n)),n=1..10); # Muniru A Asiru, Dec 11 2018
  • Mathematica
    Table[9*9!/(10-n)!, {n, 10}]
  • PARI
    apply( A073531(n)=if(n<11,9*9!\/(10-n)!), [1..13]) \\ or: 9*binomial(9,10-n)*(n-1)! without need for if(). - M. F. Hasler, Dec 10 2018
    

Formula

a(n) = 9*9!/(10-n)!.

Extensions

Keywords fini, full added by Jon E. Schoenfield, May 17 2021

A098224 Number of primes <=10^n in which decimal digits are all distinct.

Original entry on oeis.org

4, 24, 121, 631, 3160, 13399, 47349, 137859, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086, 283086
Offset: 1

Views

Author

Labos Elemer, Oct 26 2004

Keywords

Comments

Partial sums of A073532. - Lekraj Beedassy, Aug 02 2008
No number with more than 10 digits can have all of its decimal digits distinct, and no number that uses all ten distinct decimal digits can be prime (because the sum of all ten decimal digits is 45 so any such number is divisible by 3). Therefore, every term in the sequence from and after a(9) is the same, i.e., 283086. - Harvey P. Dale, Dec 12 2010

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Max[DigitCount[n]]==1
    Table[Length[Select[Prime[Range[PrimePi[10^i]]],okQ]],{i,9}] (* Harvey P. Dale, Dec 12 2010 *)
  • Python
    from sympy import sieve
    def distinct_digs(n): s = str(n); return len(s) == len(set(s))
    def aupton(terms):
      ps, alst = 0, []
      for n in range(1, terms+1):
        if n >= 10: alst.append(ps); continue
        ps += sum(distinct_digs(p) for p in sieve.primerange(10**(n-1), 10**n))
        alst.append(ps)
      return alst
    print(aupton(35)) # Michael S. Branicky, Apr 24 2021

Formula

a(n) = 283086 for n >= 9.

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

A140532 Number of primes with n distinct decimal digits, none of which are 0.

Original entry on oeis.org

4, 20, 83, 395, 1610, 5045, 12850, 23082, 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

Norman Morton (mathtutorer(AT)yahoo.com), Jul 03 2008

Keywords

Comments

a(9) is zero because 1+2+...+9 = 45 which is divisible by 3, making any number with 9 distinct digits also divisible by 3. - Wei Zhou, Oct 02 2011
The maximal distinct-digit prime without 0's is 98765431. Thus, a(n) = 0 for n >= 9. - Michael S. Branicky, Apr 20 2021

Examples

			a(1) = #{2,3,5,7} = 4.
a(2) = #{13,17,19,23,...,97} = 20. Note that the prime 11 is omitted because its decimal digits are not distinct.
		

Crossrefs

Programs

  • Mathematica
    Length /@ Table[Select[FromDigits /@ Permutations[Range@9, {i}], PrimeQ], {i,9}] (* Wei Zhou, Oct 02 2011 *)
  • 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 >= 9: return 0
      return sum(isprime(int("".join(p))) for p in permutations("123456789", n))
    print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Apr 20 2021

Extensions

Corrected by Charles R Greathouse IV, Aug 02 2010

A140959 Number of distinct-digit primes in base n.

Original entry on oeis.org

0, 1, 6, 6, 31, 130, 632, 4418, 34401, 283086, 2586883, 28637741, 336810311
Offset: 1

Views

Author

Robert G. Wilson v, Jul 25 2008

Keywords

Examples

			a(1) = 0; a(2) = 1 since only the prime 2 in base 2 has distinct integers, 10_2;
a(3) = 6 since the primes {2, 3, 5, 7, 11 & 19} in base 3 have distinct integers, {2_3, 10_3, 12_3, 21_3, 102_3, 201_3}; etc.
a(10) = 283086 because it is the partial sum of A073532.
		

Crossrefs

Cf. A073532.

Programs

  • Mathematica
    f[b_] := Block[{c = 0, k = 1, lmt = b^b}, While[p = Prime@ k; p < lmt, k++; If[ Union[ Length /@ Split@ Sort@ IntegerDigits[p, b]] == {1}, c++ ]]; c]; Array[f, 6]
  • Python
    from sympy import isprime
    from itertools import permutations
    def a(n):
        digs = "".join(str(i) for i in range(min(10, n)))
        if n > 10: digs += "".join(chr(ord("A")+i) for i in range(n-10))
        return sum(1 for i in range(1, n+1) for p in permutations(digs, i) if p[0] != '0' and isprime(int("".join(p), n)) )
    print([a(n) for n in range(1, 10)]) # Michael S. Branicky, Dec 25 2021
  • Sage
    def a(n):
        return sum(len(p.digits(n)) == len(set(p.digits(n))) for p in prime_range(n^n)) # Eric M. Schmidt, Oct 26 2014
    

Extensions

a(11)-a(12) from Eric M. Schmidt, Oct 29 2014
a(13) from Michael S. Branicky, Dec 25 2021

A366940 a(n) is the number of positive squares with n digits, all distinct.

Original entry on oeis.org

3, 6, 13, 36, 66, 96, 123, 97, 83, 87, 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

Tanya Khovanova, Oct 29 2023

Keywords

Comments

a(n) = 0, for n > 10.

Examples

			a(1)=3 because all three 1-digit squares, 1, 4, and 9, have trivially distinct digits.
a(2)=6 because all six 2-digit squares, 16, 25, 36, 49, 64, and 81, have distinct digits.
158407396 = 12586^2: has 9 distinct digits. Thus, this number contributes to a(9). On the other hand, 158382225 = 12585^2 has repeated digits. Thus, it doesn't contribute.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[100000], Length[Union[IntegerDigits[#^2]]] == k &&  Length[IntegerDigits[#^2]] == k &]], {k, 10}]
  • Python
    from math import isqrt
    from itertools import permutations
    def sqr(n): return isqrt(n)**2 == n
    def a(n):
        if n > 10: return 0
        return sum(1 for p in permutations("0123456789", n) if p[0] != '0' and sqr(int("".join(p))))
    print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Oct 29 2023

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