OFFSET
1,1
COMMENTS
The prime numbers are the sum of a near repdigit number starting with the digit j followed by k digits 0 and a nearepdigit number starting with the digit (m-1) followed by n digits 9 for m>1, or for m=1 a repdigit number with n digits 9.
The first primes are :
109, 1399, 13999, 139999, 1199999, 16999999, 289999999, 2099999999, 10999999999, 239999999999, 1099999999999, 34999999999999, 349999999999999, 2399999999999999.
Conjecture: there is always at least one k for each n.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..4000
EXAMPLE
1*10^1+1*10^2=109 prime so a(1)=2.
PROG
PFGW & SCRIPTIFY
SCRIPT
DIM k
DIM j
DIM m
DIM n, 0
DIMS t
OPENFILEOUT myf, a(n, 3).txt
LABEL a
SET n, n+1
IF n>4000 THEN END
SET j, n
LABEL b
SET j, j+1
SET k, 0
LABEL c
SET k, k+1
IF k>9 THEN GOTO b
SET m, 0
LABEL d
SET m, m+1
IF m>9 THEN GOTO c
IF 4*(k+m)%3==1 THEN GOTO d
SETS t, %d, %d, %d, %d\,; n; k; j; m
PRP m*10^n+j*10^k-1, t
IF ISPRP THEN GOTO e
GOTO d
LABEL e
WRITE myf, t
GOTO a
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Aug 14 2013
STATUS
approved