A239675 Least k > 0 such that p(n)+k is prime, where p(n) is the number of partitions of n.
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
Keywords
Examples
a(3)=2 because p(3)=3 and p(3)+1=4 is composite, but p(3)+2=5 is prime.
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).
Programs
-
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 *)
-
PARI
s=[]; for(n=0, 100, k=1; while(!isprime(numbpart(n)+k), k++); s=concat(s, k)); s \\ Colin Barker, Mar 26 2014
Comments