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.

A344789 Number of partitions of the n-th nonprime number into a nonprime number of nonprime parts.

Original entry on oeis.org

1, 2, 2, 2, 4, 3, 6, 8, 11, 11, 19, 27, 32, 37, 55, 63, 78, 88, 108, 149, 204, 232, 274, 313, 371, 497, 556, 654, 864, 1135, 1267, 1476, 1915, 2142, 2474, 2754, 3182, 4070, 4528, 5190, 5769, 6594, 8347, 10530, 11666, 13240, 14657, 16597, 20747, 22924, 25854
Offset: 1

Views

Author

Alois P. Heinz, May 28 2021

Keywords

Examples

			a(5) = 4: [9], [6,1,1,1], [4,1,1,1,1,1], [1,1,1,1,1,1,1,1,1].
a(6) = 3: [10], [4,4,1,1], [1,1,1,1,1,1,1,1,1,1].
a(7) = 6: [12], [9,1,1,1], [6,4,1,1], [4,4,1,1,1,1], [4,1,1,1,1,1,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1].
		

Crossrefs

Programs

  • Maple
    c:= proc(n) option remember; local k; if n=1 then 1 else
          for k from 1+c(n-1) while isprime(k) do od; k fi
        end:
    h:= proc(n) option remember; `if`(isprime(n), h(n-1), n) end:
    b:= proc(n, i, c) option remember; `if`(n=0 or i=1, `if`(isprime(
          c+n), 0, 1), b(n-i, h(min(n-i, i)), c+1)+b(n, h(i-1), c))
        end:
    a:= n-> b(c(n)$2, 0):
    seq(a(n), n=1..55);
  • Mathematica
    c[n_] := c[n] = Module[{k}, If[n == 1, 1,
       For[k = 1+c[n-1], PrimeQ[k], k++]; k]];
    h[n_] := h[n] = If[PrimeQ[n], h[n-1], n];
    b[n_, i_, c_] := b[n, i, c] = If[n == 0 || i == 1, If[PrimeQ[
       c+n], 0, 1], b[n-i, h[Min[n-i, i]], c+1] + b[n, h[i-1], c]];
    a[n_] := b[c[n], c[n], 0];
    Table[a[n], {n, 1, 55}] (* Jean-François Alcover, Sep 08 2022, after Alois P. Heinz *)