login
A341716
a(n) = smallest k such that the decimal concatenation n||n+1||n+2||...||n+k is prime, or -1 if no such prime exists.
9
0, 0, 3, 0, 1, 0, 1, 178
OFFSET
2,3
COMMENTS
These are the values of k from A341715. See that entry for more information.
From Chai Wah Wu, Feb 22 2021: (Start)
Theorem: For n > 1, a(n)+n is odd. If a(n) > 0, then a(n) !== 2 (mod 3) and a(n)+2n !== 0 (mod 3).
Proof: For n > 1, n||n+1||...||n+k needs to be odd to be prime, i.e., n+k is odd. n||n+1||...||n+k can be written as x+y where x = n||n||...||n||n and y = 1||0...2||...||0...k. The only exception is when n+i has more decimal digits than n for some i <= k in which case there are some extra zeros inserted into x and y.
In any case x is divisible by n and by 10..10..1 whose digit sum is k+1, i.e., x == n*(k+1) (mod 3).
Similarly the sum of digits of y mod 3 == Sum_{i=1..k} (i mod 3) == (Sum_{i=1..k} i) == k(k+1)/2 (mod 3). This means that x+y == (k+1)(k+2n)/2 (mod 3). If either k+1 or k+2n is a multiple of 3, then x+y is a multiple of 3. We know x+y > 3 since a(n) > 0 and thus x+y is not a prime.
Corollary: Suppose n > 3. If n == 0 (mod 6), then a(n) == 1 (mod 6). If n == 1 (mod 6), then a(n) == 0 (mod 6). If n == 2 (mod 6), then a(n) == 1 or 3 (mod 6). If n == 3 (mod 6), then a(n) == 4 (mod 6). If n == 4 (mod 6), then a(n) == 3 (mod 6). If n == 5 (mod 6), then a(n) == 0 or 4 (mod 6).
(End)
FORMULA
a(n) = 0 iff n is prime, otherwise a(n) = A084559(n)-n. - M. F. Hasler, Feb 22 2021
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
N. J. A. Sloane, Feb 22 2021
STATUS
approved