OFFSET
0,1
COMMENTS
The sequence is well-defined in that for each n the set of numbers with n nonprime substrings is not empty. Proof: Define m(n)=2*sum_{j=i..k} 10^j, where k=floor((sqrt(8*n+1)-1)/2), i:= n-A000217(k). For n=0,1,2,3,… the m(n) are 2, 22, 20, 222, 220, 200, 2222, 2220, 2200, 2000, 22222, 22220, ... . m(n) has k+1 digits and (k-i+1) 2’s, thus, the number of nonprime substrings of m(n) is ((k+1)*(k+2)/2)-k-1+i=(k*(k+1)/2)+i=n, which proves the statement.
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 0..200
FORMULA
a(n) >= 10^floor((sqrt(8*n-7)-1)/2) for n>0, equality holds if n is a triangular number > 0 (cf. A000217).
a(A000217(n)) = 10^(n-1), n>0.
a(A000217(n)-k) >= 10^(n-1)+k, n>0, 0<=k<n.
a(A000217(n)-1) = 10^(n-1)+2, n>3, provided 10^(n-1)+1 is not a prime (which is proved to be true for all n-1 <= 50000 (cf. A185121) except n-1=16384 and is generally true for n-1 unequal to a power of 2).
a(A000217(n)-k) = 10^(n-1)+p, where p is the minimal number such that 10^(n-1) + p, has k prime substrings, n>0, 0<=k<n.
Min(a(A000217(n)-k-i), 0<=i<=m) <= 10^(n-1)+p, where p is the minimal number with k prime substrings and m is the number of digits of p, and k+m<n.
a(A000217(n)-k) <= 10^(n-1)+max(p(i), k<=i<=k+m), where p(i) is the minimal number with i prime substrings and m is the number of digits of p(i), and k+m<n.
a(n) <= A213305(n).
EXAMPLE
a(0)=2, since 2 is the least number with zero nonprime substrings.
a(1)=1, since 1 has 1 nonprime substrings.
a(2)=11, since 11 is the least number with 2 nonprime substrings.
a(3)=10, since 10 is the least number with 3 nonprime substrings, these are 1, 0 and 10 (‘0’ will be counted).
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hieronymus Fischer, Aug 26 2012
STATUS
approved