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.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 6, 10, 13, 19, 26, 36, 47, 65, 84, 111, 144, 188, 239, 309, 390, 497, 624, 786, 978, 1224, 1513, 1875, 2306, 2839, 3469, 4246, 5162, 6279, 7600, 9196, 11077, 13344, 16006, 19191, 22934, 27387, 32602, 38788, 46015, 54547, 64504, 76209, 89835
Offset: 0

Views

Author

David S. Newman, Jun 14 2018

Keywords

Examples

			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.
		

Crossrefs

Cf. A000040.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t or isprime(i), 1, 0), `if`(i>n, 0,
          `if`(t or isprime(i), b(n, i+1, true), 0)+
           add(b(n-i*j, i+1, t), j=1..n/i)))
        end:
    a:= n-> b(n, 1, false):
    seq(a(n), n=0..70);  # Alois P. Heinz, Jun 16 2018
  • Mathematica
    nend = 30;
    For[n = 1, n <= nend, n++,
      sum[n] = 0;
      partition = {n};
      For[i = 1, i <= PartitionsP[n], i++,
       partition = NextPartition[partition];
       mex = Min[Complement[Range[n + 1], partition]];
       If [PrimeQ[mex], sum[n]++;]    ] ];
    Table[sum[i], {i, 1, nend}]