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”).

Least k > 0 such that p(n)+k is prime, where p(n) is the number of partitions of n.
5

%I #19 Jan 26 2019 14:27:07

%S 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,

%T 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,

%U 25,8,21,39,29,8,2,14,1,34,16,12,17

%N Least k > 0 such that p(n)+k is prime, where p(n) is the number of partitions of n.

%C Conjecture of Zhi-Wei Sun: a(n) <= n for n > 0.

%H Sean A. Irvine, <a href="/A239675/b239675.txt">Table of n, a(n) for n = 0..9999</a>

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1402.6641">Problems on combinatorial properties of primes</a>, arXiv:1402.6641 [math.NT], 2014-2016. See Conjecture 4.1(i).

%e a(3)=2 because p(3)=3 and p(3)+1=4 is composite, but p(3)+2=5 is prime.

%t 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 *)

%o (PARI) s=[]; for(n=0, 100, k=1; while(!isprime(numbpart(n)+k), k++); s=concat(s, k)); s \\ _Colin Barker_, Mar 26 2014

%Y Cf. A000009, A000040, A000041, A238457, A239736, A240545.

%K nonn

%O 0,4

%A _Sean A. Irvine_, Mar 23 2014