OFFSET
1,1
EXAMPLE
a(6) must end with 1, 3, 5, or 7 and all of these digits previously occurred in the sequence. So the final digit of a(6) occurs at least twice in a(1) through a(6), so every other digit must occur at least once in terms a(1) through a(6). So a(6) must include the digits 0, 4, 6 and 8, because these digits don't occur in a(1) through a(5). The smallest prime including 0, 4, 6 and 8 is 40867, so this is a(6).
a(66) = 5009 is the first term with a repeated digit. In a(1) through a(65), the digits 0, 5 and 9 occur 20 times and the other digits occur 21 times. The only primes that can be made from 0, 5 and 9 are 5, 59 and 509, all of which have already been used. 5009 is the smallest four-digit prime that includes 0, 5 and 9, because 1059, 1509, 2059, 2509, 3059, 3509, 4059 and 4509 are all composite.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Aug 04 2005
EXTENSIONS
Edited by David Wasserman, Dec 11 2008
STATUS
approved