I am trying to find the smallest expression $E(n)$, whose distances between the value of the expression and the next prime closer to the expression, $\mathcal{N}(E(n))$, and from the expression to the previous closer prime, $\mathcal{P}(E(n))$, are both prime numbers or $1$.
(1) $\mathcal{N}(E(n))-E(n)\ \in \{1,\Bbb P\}$.
(2) $E(n)-\mathcal{P}(E(n))\ \in \{1,\Bbb P\}$.
It is based in the same idea as the Fortunate Numbers, to know more about the reasons why I did the test please check here (longer explanation). I tried several combinations, but the following one seems to work properly so far and is not related with factorials or primorials, so I believe it would be easier to test:
$E(n)$={$m$ whose $\sigma_1(m)$ value is the $n^{th}$ element of the Record value sequence of $\sigma_1(m)$ (sum of divisors of m) (A034885)}$
"Record values" are defined as the subset of values $\sigma_1(m)$ of the set of sum of divisors of $m \in \Bbb N$ who are bigger than any previous values of the set, up to that value $m$, so it provides a strictly increasing set of values of $\sigma_1(m)$. Those are exactly the values of OEIS A034885 $(1,3,4,7,12,15,18,28,31,39,42...)$.
And they are exactly (thanks to @Ivan Neretin for the suggestion in the answers!) the Highly Abundant Numbers sequence (OEIS A002093):
$\{1,2,3,4,6,8,10,12,16,18,20,24,30,36,42,48...\}$
The point is that tested almost up to $10^{27}$ both the distances of those elements $E(n)$ to the previous and following closer primes (when there is a previous positive prime) is also a prime number or $1$.
Here is a sample PARI/GP code able to check easily up to $10^9$:
testlimit = 10^9;n=1;exitval=0;prevsumdiv=0;while((n<testlimit) && (exitval==0),dj=divisors(n);sum_div=0;for(t=1,length(dj),sum_div=sum_div+dj[t]);while(sum_div<=prevsumdiv,sum_div=0;n=n+1;dj=divisors(n);for(t=1,length(dj),sum_div=sum_div+dj[t]));prevsumdiv = sum_div;np=nextprime(n+1);npmn=np-n;pp=precprime(n-1);nmpp=n-pp;if((nmpp==1 || isprime(nmpp)) && (npmn==1 || isprime(npmn)), print("n= ",n," sigma1(n)= ",sum_div," N(n)= ",np," N(n)-n= ", npmn ," P(n)= ",pp," n-P(n)= ", nmpp);,exitval=1;));
After that point, I have been able to reduce the expression. It is possible to use instead of $\sigma_1(m)$ a reduced version of the sum of divisors, I will call it $\sigma_e(m)$ defined as the sum of the even composite divisors of $m$ not including $m$ itself in case of being even. In other words, it is the sum of divisors not including the sum of the prime numbers that are divisors, odd divisors, $1$ and $m$ itself. $E(n)$ is:
$E(n)$={$m$ whose $\sigma_e(m)$ value is the $n^{th}$ element of the Record value sequence of $\sigma_e(m)$ (sum of composite even divisors of m not including m in case of being even)}$
So it is not required to use A034885 anymore. Apart from this expression, I tried also using the sum of the prime divisors of $m$, and other combinations of partial sums of the divisors of $m$, including $1$ and $m$ itself, but those ones did not work. The even divisors seem to be the key.
This is an example including the interval [1,99].
Please I would like to ask the following questions:
Why does it happen? I can not imagine which possible reason is behind that property. Some insights would be very welcomed!
Are there similar expressions based on other non-factorial functions? so far I have tried using the totient function and some sums of divisors of even numbers instead of $\sigma_e(n)$, all of them unsuccessfully.
I did not find any reference to this property, if it was already tested please I would like to know about it. Thank you!
Last update 2016/01/05: amazingly $\forall h \in $ {Highly Abundant Numbers}, $h\gt3$,tested up to $10^{27}$ no counterexamples found, the closest prime number $p \lt h$ located to a distance $d=(h-p) \gt 1$ is also always at a prime distance, so $d \in \Bbb P$. If the test is not wrong, these would mean that the even Highly Abundant Numbers greater than $2$ have always at least a Goldbach pair of primes. $h=p+d, p,d\in\Bbb P$

Your $E(n)$ (according to the first definition) is in fact A002093, the highly abundant numbers. BTW, the OEIS contains a list of those up to ~$10^{27}$, and nextprime() is relatively fast, so you may use these data to check your conjecture up to that limit.
Much like primorials, these numbers are divisible by all "small" primes, so the distance to the next prime can't be divisible by those, so for it to be composite, it has to be a product of "bigger" primes, and that's just too big. These are but some vague heuristic considerations; a rigorous proof has every chance to be as elusive as that of the fortunate numbers conjecture.