login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A239675
Least k > 0 such that p(n)+k is prime, where p(n) is the number of partitions of n.
5
1, 1, 1, 2, 2, 4, 2, 2, 1, 1, 1, 3, 2, 2, 2, 3, 2, 10, 4, 1, 4, 5, 7, 4, 4, 15, 1, 1, 1, 2, 19, 15, 4, 8, 13, 4, 4, 10, 2, 4, 1, 4, 15, 16, 6, 3, 5, 5, 10, 6, 7, 4, 20, 10, 4, 1, 6, 13, 3, 1, 14, 4, 25, 8, 21, 39, 29, 8, 2, 14, 1, 34, 16, 12, 17
OFFSET
0,4
COMMENTS
Conjecture of Zhi-Wei Sun: a(n) <= n for n > 0.
LINKS
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