I was successful in working out the bugs, now I can specify a range of numbers that I want to test for primality. I'll provide an example, here I test for primes between 10 and 100
N[Sum[2/(10^(Mod[-(10 - n^2), n]*4)*
(10^(n*4) - 1)),
{n, 1, Sqrt[10000]}], (10000 - 10)*4]
str = StringDrop[ToString[%], 2]
(1/4)*Last /@ StringPosition[str,
"0002"] + 10
Out[175]= \
0.02040204060602080210060402120404060802120208040406120204041202100206\
0804021204080406021004100404021402040808040802060410021402040606040802\
1206040212040404080214040604040412020606100
Out[176]= \
"020402040606020802100604021204040608021202080404061202040412021002060\
8040212040804060210041004040214020408080408020604100214020406060408021\
206040212040404080214040604040412020606100"
Out[177]= {11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, \
67, 71, 73, 79, 83, 89, 97}
It's really easy, just follow the formula:
[\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\),
RadicalBox[\(max\), \(2\)]]\(2/
10^\((\((Mod[\(-\((\((min)\))\)\) - \((n^2)\),
n])\) spacing)\) \((\((10^\((n*spacing)\))\) -
1)\)\)\), (max - min)*spacing]
For those of you who are following, you will need to know how to find the spacing. The spacing is determined using a couple of formulas, in these examples below, I am solving for the LCM of 1-1000. The First Formula, I would keep adding the log10 of primes until I arrive at the max number I want to test for. Once I find that prime, I input that into the second formula to find the bonus range. The output from the first formula and the second are added together properly by converting the logs back into numbers first before adding them together, otherwise just adding the logs is like multiplying those numbers together. This yields the overall max that could be used to test with. The third formula yields the number of divisors of an LCM of 1-n and taking the log10 of it determines the spacing needed to pad the decimal expansion with. Using that prime number again from the first formula, it is inputted into the third formula to yield the spacing. It all looks like this:
AbsoluteTiming[N[Sum[Log[Prime[n]]/Log[10], {n, 1, 1000}], 13]]
{0.031222, 3392.831632804}
N[10^3392.83163280386907722938003534866124707481`13.]
6.78629608*10^3392
N[Sum[(1/Log[10])*(-2 + x)*Log[Prime[p + PrimePi[1000^(1/x)]]],
{x, 3, 1 + Floor[Log[1000]/Log[2]]},
{p, 1, PrimePi[1000^(1/(-1 + x))] - PrimePi[1000^(1/x)]}], 13]
17.56097841949
N[10^17.56097841949371816986880298169279418524`13.]
3.63897*10^17
6.786296084197555149532660048969925646446`9.107222002718924*^3392 + \
3.63896953291872`*^17
6.786296084197555*10^3392
is the max
N[1 + Floor[Log10[Product[x^(PrimePi[Prime[1000]^(1/(-1 + x))] -
PrimePi[Prime[1000]^(1/x)]),
{x, 2, 1 + Floor[Log[Prime[1000]]/Log[2]]}]]]]
Out[178]= 308.
308 is the spacing required to test for primes under the max, 6.786296084197555*10^3392. That alot of primes for such little spacing. Pretty neat, right? Don't forget to vote, I could use some reputation improvement.
Oh, I just got an answer on how to get more zeros in front of the two so that you will have something to search with. Use:
PaddedForm[2, spacing, NumberPadding -> {"0", "0"}]
And I should point out that my computer is pretty tops, and it easily does a range of 10000 at a time. I wouldn't try for 6.786296084197555*10^3392. It was just an example, sorry I didn't use one that is practical or usable.
A spacing of 4 will get you pretty far, up to 6.46969359`*^9 at least.
One more thing, a bug I haven't worked out yet but is easy to work around, when you do get the display of primes and there is a number that did not divide by the spacing, it will display as a fraction and can be ignored as a false positive. I've seen a lot of false positives when the computer comes across a 0022 instead of a 0002. I've compared lists and they do happen, it's not a perfect system yet. That will be my next question...