

A160369


Largest base 10 nearrepdigit (all but one digit alike) prime with digit n repeated n times (or 0, if no such prime exists).


0




OFFSET

1,1


COMMENTS

Each a(n) must be n + 1 digits long in base 10.
The different digit must not be 0, or else the near repdigit is divisible by n.
Our search is simplified by the fact that for even n, the different digit must be at the end. Furthermore, the different digit must be 1, 3, 7 or 9 (that is, not 5). In the case of n = 6, the choice of final digit is reduced further still to 1 or 7. 6666661 is divisible by 113, while 6666667 is divisible by 7. Therefore there is no term for a(6) and a 0 is entered instead. (The equivalent sequence for smallest prime nearrepdigit would have a similar void for a(6)).
For odd n, the different digit may be placed at any position, but at least in verifying n = 7 and n = 9 it helped expedite the search to focus on nearrepdigits with the different digit greater than n and placed as the most significant digit or near the most significant digit. For example, with n = 7, it was not necessary to look at a number like 76777777 since it's smaller than the term to be verified, 77777747.
The equivalent sequence in binary has only one term: 2!


LINKS

Table of n, a(n) for n=1..9.


EXAMPLE

Nearrepdigits with three 3s are 9333, 8333, 7333, 6333, ... 3933, 3833, etc. The largest of these, 9333, is obviously divisible by 3. Not as obviously, 8333 is divisible by 13 and 641. Then we see that 7333 is prime, therefore a(3) = 7333.


CROSSREFS

Cf. A105975A105982, A160342
Sequence in context: A142076 A096698 A159472 * A001126 A140628 A123038
Adjacent sequences: A160366 A160367 A160368 * A160370 A160371 A160372


KEYWORD

fini,full,nonn,base


AUTHOR

Lekraj Beedassy, May 11 2009


EXTENSIONS

Terms verified by Alonso del Arte, Nov 19 2009


STATUS

approved



