|
Search: id:A132129
|
|
|
| A132129 |
|
Largest prime with distinct digits when written in base n. |
|
+0 1
|
|
| 2, 19, 19, 577, 7417, 114229, 2053313, 42373937, 987654103
(list; graph; listen)
|
|
|
OFFSET
|
2,1
|
|
|
COMMENT
|
R. J. Mathar's program confirms a(2) - a(10) and proves that a(11) does not exist.
a(10) = 987654103 = A007810(9). For n >= 3, a(n) < A062813(n), a multiple of n.
|
|
EXAMPLE
|
a(9) = 42373937 as the prime 42373937 (base 10) = 87654102 (base 9), the largest prime number with distinct digits when represented in base 9.
|
|
MAPLE
|
rebase := proc(L, b) add(op(-i, L)*b^(i-1), i=1..nops(L)) ; end: A132129rec := proc(L, n, ndigs) local a, d ; if nops(L) < ndigs then for d from n-1 to 0 by -1 do if not d in L then a := A132129rec([op(L), d], n, ndigs) ; if a > 0 then RETURN(a) ; fi ; fi ; od: RETURN(-1) ; else a := rebase(L, n) ; if isprime(a) then RETURN(a) ; else RETURN(-1) ; fi ; fi ; end: A132129 := proc(n) local d, L, a, ndgs ; for ndgs from n to 1 by -1 do for d from n-1 to 0 by -1 do L := [d] ; a := A132129rec(L, n, ndgs) ; if a > 0 then RETURN(a) ; fi ; od: od; end: for n from 2 do print(n, A132129(n)) ; od: - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Oct 24 2007
|
|
CROSSREFS
|
Cf. A062813, A007810, A029743.
Adjacent sequences: A132126 A132127 A132128 this_sequence A132130 A132131 A132132
Sequence in context: A096481 A065643 A038031 this_sequence A125611 A022119 A042247
|
|
KEYWORD
|
base,fini,full,nonn
|
|
AUTHOR
|
Rick L. Shepherd (rshepherd2(AT)hotmail.com), Aug 11 2007
|
|
|
Search completed in 0.002 seconds
|