OFFSET
0,4
COMMENTS
Conjecture of Zhi-Wei Sun: a(n) <= n for n > 0.
LINKS
Sean A. Irvine, Table of n, a(n) for n = 0..9999
Zhi-Wei Sun, Problems on combinatorial properties of primes, arXiv:1402.6641 [math.NT], 2014-2016. See Conjecture 4.1(i).
EXAMPLE
a(3)=2 because p(3)=3 and p(3)+1=4 is composite, but p(3)+2=5 is prime.
MATHEMATICA
a[n_] := a[n] = For[pn = PartitionsP[n]; k = 1, True, k++, If[PrimeQ[pn+k], Return[k]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 26 2019 *)
PROG
(PARI) s=[]; for(n=0, 100, k=1; while(!isprime(numbpart(n)+k), k++); s=concat(s, k)); s \\ Colin Barker, Mar 26 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Sean A. Irvine, Mar 23 2014
STATUS
approved