A098225 Duplicate of A073532.
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
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.
a(1)=1023467 because it is the first (smallest) 7-digit prime with all distinct digits.
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
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 *)
is(n)=isprime(n) && #digits(n)==7 && #Set(digits(n))==7 \\ Charles R Greathouse IV, Feb 11 2017
a(3) = 648 because there are 648 three-digit integers with distinct digits.
List([1..10],n->9*Factorial(9)/(Factorial(10-n))); # Muniru A Asiru, Dec 11 2018
[9*Factorial(9)/Factorial(10-n): n in [1..10]]; // Vincenzo Librandi, Dec 13 2018
seq(9*factorial(9)/(factorial(10-n)),n=1..10); # Muniru A Asiru, Dec 11 2018
Table[9*9!/(10-n)!, {n, 10}]
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
okQ[n_]:=Max[DigitCount[n]]==1 Table[Length[Select[Prime[Range[PrimePi[10^i]]],okQ]],{i,9}] (* Harvey P. Dale, Dec 12 2010 *)
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
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 *)
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.
Length /@ Table[Select[FromDigits /@ Permutations[Range@9, {i}], PrimeQ], {i,9}] (* Wei Zhou, Oct 02 2011 *)
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
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.
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]
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
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
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.
Table[Length[Select[Range[100000], Length[Union[IntegerDigits[#^2]]] == k && Length[IntegerDigits[#^2]] == k &]], {k, 10}]
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
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.
Comments