login
A196129
A002110(n)-(p[i]+p[i+1]+...+p[i+n-1]), where p[i] is the largest prime such that this is nonnegative.
3
0, 1, 7, 8, 13, 28, 51, 72, 31, 124, 3, 78, 331, 226, 119, 514, 517, 120, 85, 108, 423, 176, 1163, 830, 1935, 700, 2133, 1104, 1903, 730, 1811, 1318, 703, 1058, 3063, 344, 2337, 5816, 1945, 4162, 5801, 5498, 6337, 3998, 4501, 7376, 3617, 5430, 6891, 8786, 155, 4660, 8523, 790, 6203, 9742, 11389, 10792, 793
OFFSET
1,3
COMMENTS
It is an open problem whether there is n>1 (necessarily even) such that a(n)=0.
LINKS
J. M. Bergot, C. Rivera (Ed.), Problem 56. p1*p2*…*pk = q1+q2+…+qk, on primepuzzle.net.
MATHEMATICA
a[n_] := (primorial = Product[Prime[k], {k, 1, n}]; s = NextPrime[Quotient[primorial, n], -1]; p = s; q = s; For[k = 1, k <= n, k++, s += If[s*n > primorial*k, p = NextPrime[p - 1, -1], q = NextPrime[q + 1]]]; primorial - s + q); a[1] = 0; a[2] = 1; Table[a[n], {n, 1, 59}] (* Jean-François Alcover, Jun 11 2013, translated and adapted from Pari *)
PROG
(PARI) A196129(k)={my(P=A002110(k), S=precprime(P\k), p=S, q=S); for(n=1, k, S+=if(S*k>P*n, p=precprime(p-1), q=nextprime(q+1))); P-S+q}
CROSSREFS
The primes p[i] are given in A196128.
Sequence in context: A045765 A118068 A060754 * A286261 A136037 A085334
KEYWORD
nonn
AUTHOR
M. F. Hasler, Sep 28 2011
STATUS
approved