

A110457


a(n) is the least prime not already used such that the frequencies of the decimal digits in the first n terms are almost equal, i.e., for any two digits, their numbers of occurrences differ by no more than 1.


0



2, 3, 5, 7, 19, 40867, 13, 29, 405683, 17, 59, 206483, 41, 67, 89, 2053, 47, 61, 509, 281, 23, 79, 405689, 31, 257, 46807, 43, 109, 25867, 53, 149, 20681, 37, 269, 40583, 71, 409, 28657, 83, 241, 569, 103, 97, 2046853, 107, 659, 2843, 127, 809, 4561, 73, 829, 45061, 239, 457, 6089, 137, 2046857, 139, 2048569, 157, 263, 4801, 283, 467, 5009, 163, 479, 2851, 293, 487, 6053, 167, 859, 4021, 307, 2459, 683, 179
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


LINKS

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


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 fourdigit prime that includes 0, 5 and 9, because 1059, 1509, 2059, 2509, 3059, 3509, 4059 and 4509 are all composite.


CROSSREFS

Sequence in context: A158473 A048420 A048405 * A320584 A209191 A162948
Adjacent sequences: A110454 A110455 A110456 * A110458 A110459 A110460


KEYWORD

base,nonn


AUTHOR

Amarnath Murthy, Aug 04 2005


EXTENSIONS

Edited by David Wasserman, Dec 11 2008


STATUS

approved



