cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A305937 #13 Jun 16 2018 16:00:03
%S A305937 0,1,1,2,3,5,6,10,13,19,26,36,47,65,84,111,144,188,239,309,390,497,
%T A305937 624,786,978,1224,1513,1875,2306,2839,3469,4246,5162,6279,7600,9196,
%U A305937 11077,13344,16006,19191,22934,27387,32602,38788,46015,54547,64504,76209,89835
%N A305937 Number of partitions such that the least positive integer which is not a part of the partition is prime.
%H A305937 Alois P. Heinz, <a href="/A305937/b305937.txt">Table of n, a(n) for n = 0..10000</a>
%e A305937 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 A305937 b:= proc(n, i, t) option remember; `if`(n=0,
%p A305937       `if`(t or isprime(i), 1, 0), `if`(i>n, 0,
%p A305937       `if`(t or isprime(i), b(n, i+1, true), 0)+
%p A305937        add(b(n-i*j, i+1, t), j=1..n/i)))
%p A305937     end:
%p A305937 a:= n-> b(n, 1, false):
%p A305937 seq(a(n), n=0..70);  # _Alois P. Heinz_, Jun 16 2018
%t A305937 nend = 30;
%t A305937 For[n = 1, n <= nend, n++,
%t A305937   sum[n] = 0;
%t A305937   partition = {n};
%t A305937   For[i = 1, i <= PartitionsP[n], i++,
%t A305937    partition = NextPartition[partition];
%t A305937    mex = Min[Complement[Range[n + 1], partition]];
%t A305937    If [PrimeQ[mex], sum[n]++;]    ] ];
%t A305937 Table[sum[i], {i, 1, nend}]
%Y A305937 Cf. A000040.
%K A305937 nonn
%O A305937 0,4
%A A305937 _David S. Newman_, Jun 14 2018