login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of partitions such that the least positive integer which is not a part of the partition is prime.
1

%I #13 Jun 16 2018 16:00:03

%S 0,1,1,2,3,5,6,10,13,19,26,36,47,65,84,111,144,188,239,309,390,497,

%T 624,786,978,1224,1513,1875,2306,2839,3469,4246,5162,6279,7600,9196,

%U 11077,13344,16006,19191,22934,27387,32602,38788,46015,54547,64504,76209,89835

%N Number of partitions such that the least positive integer which is not a part of the partition is prime.

%H Alois P. Heinz, <a href="/A305937/b305937.txt">Table of n, a(n) for n = 0..10000</a>

%e For n=3 there are three unrestricted partitions: 3, 2+1, and 1+1+1. The least positive integer not in the first partition is 1. One is not a prime so the first partition is not counted. For the second partition the smallest missing positive integer is 3, which is prime. For the third partition the missing number is 2, which is prime. So a(3)=2.

%p b:= proc(n, i, t) option remember; `if`(n=0,

%p `if`(t or isprime(i), 1, 0), `if`(i>n, 0,

%p `if`(t or isprime(i), b(n, i+1, true), 0)+

%p add(b(n-i*j, i+1, t), j=1..n/i)))

%p end:

%p a:= n-> b(n, 1, false):

%p seq(a(n), n=0..70); # _Alois P. Heinz_, Jun 16 2018

%t nend = 30;

%t For[n = 1, n <= nend, n++,

%t sum[n] = 0;

%t partition = {n};

%t For[i = 1, i <= PartitionsP[n], i++,

%t partition = NextPartition[partition];

%t mex = Min[Complement[Range[n + 1], partition]];

%t If [PrimeQ[mex], sum[n]++;] ] ];

%t Table[sum[i], {i, 1, nend}]

%Y Cf. A000040.

%K nonn

%O 0,4

%A _David S. Newman_, Jun 14 2018