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 near-repdigit 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 near-repdigits 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!
EXAMPLE
Near-repdigits 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
KEYWORD
fini,full,nonn,base
AUTHOR
Lekraj Beedassy, May 11 2009
EXTENSIONS
Terms verified by Alonso del Arte, Nov 19 2009
STATUS
approved