OFFSET
1,13
COMMENTS
a(n) = -1 when n = 3*k because no matter how many 3's are appended to n, the resulting number is always divisible by 3 and therefore cannot be prime.
a(n) = -1 when n = 37037*k + 2808, 3666, 4070, 9287, 18799, 21574, 28083, 30558, 33300, 33740, 36663 or 36707, because n followed by any positive number, m say, of 3's is divisible by at least one of the primes {7,11,13,37}.
a(817) > 300000 or a(817) = -1.
LINKS
Toshitaka Suzuki, Table of n, a(n) for n = 1..816
EXAMPLE
a(20)=3 because 203 and 2033 are composite but 20333 is prime.
MATHEMATICA
snm[n_]:=Module[{k=1}, If[Mod[n, 3]==0, -1, While[CompositeQ[FromDigits[ PadRight[ IntegerDigits[ n], k+ IntegerLength[ n], 3]]], k++]; k]]; Array[snm, 80] (* Harvey P. Dale, Aug 06 2024 *)
CROSSREFS
KEYWORD
sign,base
AUTHOR
Toshitaka Suzuki, Apr 24 2024
STATUS
approved