OFFSET
1,8
COMMENTS
a(38) = -1 means no prime has yet been found; a(176) = -1 because it has been proved never to reach a prime. a(45) = 772 and a(56) = 18470 found by Richard Heylen; a(45) has been proved prime while a(56) is 3-PRP.
Number of times 1 has to be repeatedly appended to n to form a prime. - Lekraj Beedassy, Jun 01 2006
The statement "no prime has yet been found" is misleading: if a(n) was unknown, the terms listed here should stop at a(n-1). A term a(n) = -1 means it can be proven that it will never yield a prime. We can show this for n = 38, see Examples. - M. F. Hasler, Jun 05 2024
LINKS
Toshitaka Suzuki, Table of n, a(n) for n = 1..602
Jon Perry, Wilde Primes (backup on web.archive.org as of Feb. 2007, ceased to exist in 2007).
EXAMPLE
a(8) = 2 because 8 and 81 are composite but 811 is prime.
From M. F. Hasler, Jun 05 2024: (Start)
For n = 38, a(38) = -1 because the number 38 with m ones appended is divisible by 3 whenever m == 1 (mod 3) and by 37 for m == 2 (mod 3), and for m = 3k, k >= 0, it equals (x^3 - 1)/9 = (x - 1)/3 * (x^2 + x + 1)/3 with x = 7*10^k.
For n = 176, a(176) = -1 because appending any number m of 1's will always yield a number divisible by 11 if m is even, by 3 if m == 1 (mod 3), by 7 if m == 5 (mod 6) or by 13 if m == 3 (mod 6). (End)
PROG
(PARI) { aop(n, stop=500) = for(c=0, stop, isprime(n) && return(c); n=n*10+1); -1 } \\ Return value -1 means that a(n) = -1 or a(n) > stop, the search limit given as 2nd optional parameter.
CROSSREFS
KEYWORD
base,sign
AUTHOR
Jason Earls, Jun 16 2003
EXTENSIONS
Definition and PARI/GP code edited by M. F. Hasler, Jun 05 2024
STATUS
approved