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.

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

This page as a plain text file.
%I A132129 #16 Aug 15 2025 00:58:45
%S A132129 2,19,19,577,7417,114229,2053313,42373937,987654103,25678048763,
%T A132129 736867805209,23136292864193,789018236128391,29043982525257901,
%U A132129 1147797409030815779,48471109094902530293,2178347851919531491093,103805969587115219167613,5228356786703601108008083
%N A132129 Largest prime with distinct digits when written in base n.
%C A132129 a(10) = 987654103 = A007810(9). For n >= 3, a(n) < A062813(n), a multiple of n.
%C A132129 Contribution from _R. J. Mathar_, May 15 2010: (Start)
%C A132129 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).
%C A132129 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.
%C A132129 In conclusion, if n is even, the entries have at most n-1 digits in base n. (End)
%C A132129 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
%H A132129 Eric M. Schmidt, <a href="/A132129/b132129.txt">Table of n, a(n) for n = 2..200</a>
%e A132129 a(9) = 42373937 as the prime 42373937 (base 10) = 87654102 (base 9), the largest prime number with distinct digits when represented in base 9.
%o A132129 (Sage) def a(n) :
%o A132129     if n==2 : return 2
%o A132129     if n==3 : return 19
%o A132129     for P in Permutations(range(n-1,-1,-1), n-1) :
%o A132129         N = sum(P[-1-i]*n^i for i in range(n-1))
%o A132129         if is_prime(N) : return N
%o A132129 # _Eric M. Schmidt_, Oct 26 2014
%Y A132129 Cf. A062813, A007810, A029743.
%K A132129 base,nonn
%O A132129 2,1
%A A132129 _Rick L. Shepherd_, Aug 11 2007
%E A132129 Removed my claim of finiteness of the sequence. - _R. J. Mathar_, May 18 2010
%E A132129 a(11)-a(20) from _Eric M. Schmidt_, Oct 26 2014