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.

Previous Showing 21-30 of 32 results. Next

A132129 Largest prime with distinct digits when written in base n.

Original entry on oeis.org

2, 19, 19, 577, 7417, 114229, 2053313, 42373937, 987654103, 25678048763, 736867805209, 23136292864193, 789018236128391, 29043982525257901, 1147797409030815779, 48471109094902530293, 2178347851919531491093, 103805969587115219167613, 5228356786703601108008083
Offset: 2

Views

Author

Rick L. Shepherd, Aug 11 2007

Keywords

Comments

a(10) = 987654103 = A007810(9). For n >= 3, a(n) < A062813(n), a multiple of n.
Contribution from R. J. Mathar, May 15 2010: (Start)
Supposed all digits are used and the digits at positions 0 to n-1 are d_0, d_1,... d_{n-1}, the candidates are d_0+d_1*n+d_2*n^2+....+d_{n-1}*n^(n-1).
These values are (n-1)*n/2 (mod n-1), and they cannot be prime if n is even, because this number is = 0 (mod n-1) then, showing that n-1 is a divisor.
In conclusion, if n is even, the entries have at most n-1 digits in base n. (End)
If n is odd then the candidate numbers considered in the previous comment are divisible by (n-1)/2. Hence, we conclude that for n>3, a(n) has at most n-1 digits in base n. Conjecture: for n>3, a(n) has exactly n-1 digits in base n. - Eric M. Schmidt, Oct 26 2014

Examples

			a(9) = 42373937 as the prime 42373937 (base 10) = 87654102 (base 9), the largest prime number with distinct digits when represented in base 9.
		

Crossrefs

Programs

  • Sage
    def a(n) :
        if n==2 : return 2
        if n==3 : return 19
        for P in Permutations(range(n-1,-1,-1), n-1) :
            N = sum(P[-1-i]*n^i for i in range(n-1))
            if is_prime(N) : return N
    # Eric M. Schmidt, Oct 26 2014

Extensions

Removed my claim of finiteness of the sequence. - R. J. Mathar, May 18 2010
a(11)-a(20) from Eric M. Schmidt, Oct 26 2014

A256339 Distinct-digit primes that are concatenation of prime(m) and m for some m.

Original entry on oeis.org

53, 239, 6719, 7321, 4073561, 6257813, 6521843, 85271063
Offset: 1

Views

Author

Zak Seidov, Mar 25 2015

Keywords

Comments

The last term is a(8) = 85271063 (prime) because all 8 digits are different and m=1063 with 8527=prime(m).

Crossrefs

Subsequence of A029743 (distinct-digit primes).

Programs

  • Mathematica
    Select[FromDigits[IntegerDigits[Prime@ #]~Join~IntegerDigits@ #] & /@
    Range@ 1200, PrimeQ@ # && Max@ DigitCount@ # == 1 &] (* Michael De Vlieger, Mar 25 2015 *)

A259146 Smallest prime with first n digits distinct.

Original entry on oeis.org

2, 13, 103, 1039, 10243, 102359, 1023467, 10234589, 102345689, 10234567897
Offset: 1

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Comments

The sequence is complete: n=1..10.

Crossrefs

Programs

  • Python
    from sympy import nextprime
    def a(n):
      p = nextprime(10**(n-1))
      while len(set(str(p)[:n])) < n: p = nextprime(p)
      return p
    for n in range(1, 11):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021

Formula

a(n) = A007809(n), n<=9. - R. J. Mathar, Jul 06 2015

A259152 a(n) = smallest n-digit prime with first 10 digits distinct.

Original entry on oeis.org

10234567897, 102345678907, 1023456789013, 10234567890077, 102345678900007, 1023456789000073, 10234567890000053, 102345678900000059, 1023456789000000049, 10234567890000000007
Offset: 11

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Comments

There is no 10-digit prime with the first 10 digits distinct, hence offset=11.

Crossrefs

Programs

A259187 Primes p such that both p and p^2 are distinct-digit numbers.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 43, 53, 59, 61, 71, 73, 79, 89, 137, 179, 193, 269, 281, 367, 397, 463, 487, 509, 571, 593, 647, 709, 829, 839, 1307, 1873, 2069, 2731, 2801, 3041, 4157, 4967, 4987, 6043, 7549, 7621, 8623, 21397
Offset: 1

Views

Author

Zak Seidov, Jun 20 2015

Keywords

Comments

Corresponding squares are 4, 9, 25, 49, 169, 289, 361, 529, 841, 961, 1369, 1849, 2809, 3481, 3721, 5041, 5329, 6241, 7921, 18769, 32041, 37249, 72361, 78961, 134689, 157609, 214369, 237169, 259081, 326041, 351649, 418609, 502681, 687241, 703921, 1708249, 3508129, 4280761, 7458361, 7845601, 9247681, 17280649, 24671089, 24870169, 36517849, 56987401, 58079641, 74356129, 457831609 (subsequence of A078255).

Crossrefs

Subsequence of A029743 and of A119509. Cf. A078255.

Programs

  • Mathematica
    Select[Prime[Range[2500]],Max[DigitCount[#]]<2&&Max[DigitCount[#^2]]<2&] (* Harvey P. Dale, May 25 2020 *)

A262250 Primes having exactly one digit in {1, 3, 7, 9}.

Original entry on oeis.org

3, 7, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 223, 227, 229, 241, 251, 257, 263, 269, 281, 283, 401, 409, 421, 443, 449, 457, 461, 463, 467, 487, 503, 509, 521, 523, 541, 547, 557, 563, 569, 587, 601, 607, 641, 643, 647, 653, 659, 661, 683, 809, 821, 823, 827, 829, 853, 857, 859, 863, 881, 883, 887, 2003, 2027, 2029, 2053
Offset: 1

Views

Author

Vladimir Shevelev, Sep 21 2015

Keywords

Comments

How can one prove that the sequence is infinite?
Probabilistic arguments imply that the number of terms not exceeding x is not less than 5/9*log(10)/log(6)*x^(log(6)/log(10))/log(x) = 0.7139...*x^0.778.../log(x).

Crossrefs

Programs

  • Mathematica
    Select[Prime@ Range@ 310, Total@ Drop[First /@ Partition[DigitCount@ #, 2, 2], {3}] == 1 &] (* Michael De Vlieger, Sep 21 2015 *)
  • PARI
    nbd(vd, d) = #select(i->(i == d), vd);
    lista(nn) = {forprime(p=2, nn, vd = digits(p); if (nbd(vd,1) + nbd(vd,3) + nbd(vd,7) + nbd(vd,9) == 1, print1(p, ", ")););} \\ Michel Marcus, Sep 22 2015
    
  • PARI
    list(lim)=my(v=List([3])); forprime(p=7,lim, if(#setintersect(Set(digits(p\10)), [1,3,7,9])==0, listput(v,p))); Vec(v) \\ Charles R Greathouse IV, Sep 22 2015
    
  • Perl
    use ntheory ":all"; say join ", ", grep { tr/1379// == 1 } @{primes(3000)}; # Dana Jacobsen, Oct 13 2015

A323391 Primes containing nonprime digits (from 1 to 9) in their decimal expansion and whose digits are distinct, i.e., consisting of only digits 1, 4, 6, 8, 9.

Original entry on oeis.org

19, 41, 61, 89, 149, 419, 461, 491, 619, 641, 691, 941, 1489, 4691, 4861, 6481, 6491, 6841, 8419, 8461, 8641, 8941, 9461, 14869, 46819, 48619, 49681, 64189, 64891, 68491, 69481, 81649, 84691, 84961, 86491, 98641
Offset: 1

Views

Author

Bernard Schott, Jan 13 2019

Keywords

Comments

There are only 36 terms in this sequence, which is a finite subsequence of A152313.
Two particular examples:
6481 is also the smallest prime formed from the concatenation of two consecutive squares.
81649 is the only prime containing all the nonprime positive digits such that every string of two consecutive digits is a square.

Examples

			14869 is the smallest prime that contains all the nonprime positive digits; 98641 is the largest one.
		

Crossrefs

Subsequence of A152313. Subsequence of A029743. Subsequence of A155024 (with distinct nonprime digits but with 0) and of A034844.
Cf. A029743 (with distinct digits), A124674 (with distinct prime digits), A155045 (with distinct odd digits), A323387 (with distinct square digits), A323578 (with distinct digits for which parity of digits alternates).

Programs

  • Mathematica
    Select[Union@ Flatten@ Map[FromDigits /@ Permutations@ # &, Rest@ Subsets@ {1, 4, 6, 8, 9}], PrimeQ] (* Michael De Vlieger, Jan 19 2019 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p)) && vecmin(d) && (#Set(d) == #d) && (#select(x->isprime(x), d) == 0); \\ Michel Marcus, Jan 14 2019

A385711 Primes whose digits are all distinct and pairwise coprime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 127, 137, 149, 157, 167, 173, 179, 197, 251, 257, 271, 317, 347, 419, 431, 457, 479, 491, 521, 523, 541, 547, 571, 587, 617, 719, 743, 751, 761, 853, 857, 859, 941, 947, 971, 1237, 1259
Offset: 1

Views

Author

Gonzalo Martínez, Jul 07 2025

Keywords

Comments

This sequence has 252 terms, the last being 95471, which have at most 5 digits. This is because each term has at most one even digit and at most 4 odd digits, since gcd(3, 9) = 3.
All terms are in A038618, since if zero is among the digits of a prime p, then p must have at least 3 digits, where at least one of them is greater than 1, say d, and in such a case gcd(0, d) = d ! = 1.

Examples

			857 is a term since it is prime and gcd(8, 5) = gcd(5, 7) = gcd(8, 7) = 1.
		

Crossrefs

Subsequence of A029743.
Cf. A038618.

Programs

  • Mathematica
    Select[Prime[Range[10000]], UnsameQ @@ (d = IntegerDigits[#]) && AllTrue[Subsets[d, {2}], CoprimeQ @@ # &] &] (* Amiram Eldar, Jul 13 2025 *)

A085453 Numbers n such that n^2 and n^3 together use only distinct digits.

Original entry on oeis.org

2, 3, 8, 9, 24, 69
Offset: 1

Views

Author

Zak Seidov, Jul 01 2003

Keywords

Comments

There are only six such numbers (in base 10). Numbers with distinct digits in A010784. Primes with distinct digits in A029743. The case n and n^2 (exactly 22 numbers) in A059930. The case n and prime[n] (exactly 101 numbers) in A085451.

Examples

			69 is (the last) term because 69^2=4761 and 69^3=328509 together use all 10 distinct digits.
		

Crossrefs

Programs

  • Mathematica
    bb = {}; Do[idpn = IntegerDigits[n^3]; idn = IntegerDigits[n^2]; If[Length[idn] + Length[idpn] == Length[Union[idn, idpn]], bb = {bb, n}], {n, 1, 10000}]; Flatten[bb]

A250173 Primes with distinct digits: a(n) is the least prime > a(n-1) such that a(n-1) and a(n) share no common digit.

Original entry on oeis.org

2, 5, 7, 13, 29, 31, 47, 53, 61, 73, 89, 103, 257, 349, 521, 607, 821, 907, 1283, 4057, 6329, 7451, 8039, 12457, 30689, 41257, 63809, 74521, 80369
Offset: 1

Views

Author

Zak Seidov, Dec 05 2014

Keywords

Crossrefs

Subsequence of A029743.
Previous Showing 21-30 of 32 results. Next