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.

Showing 1-4 of 4 results.

A316185 Number of strict integer partitions of the n-th prime into a prime number of prime parts.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 2, 2, 3, 5, 5, 6, 8, 10, 13, 18, 20, 26, 32, 34, 45, 54, 66, 90, 106, 117, 135, 142, 165, 269, 311, 375, 398, 546, 579, 689, 823, 938, 1107, 1301, 1352, 1790, 1850, 2078, 2153, 2878, 3811, 4241, 4338, 4828, 5495, 5637, 7076, 8000, 9032
Offset: 1

Views

Author

Gus Wiseman, Jun 25 2018

Keywords

Examples

			The a(14) = 8 partitions of 43 into a prime number of distinct prime parts: (41,2), (31,7,5), (29,11,3), (23,17,3), (23,13,7), (19,17,7), (19,13,11), (17,11,7,5,3).
		

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 0,
         `if`(isprime(n), n, h(n-1)))
        end:
    b:= proc(n, i, c) option remember; `if`(n=0,
          `if`(isprime(c), 1, 0), `if`(i<2, 0, b(n, h(i-1), c)+
          `if`(i>n, 0, b(n-i, h(min(n-i, i-1)), c+1))))
        end:
    a:= n-> b(ithprime(n)$2, 0):
    seq(a(n), n=1..56);  # Alois P. Heinz, May 26 2021
  • Mathematica
    Table[Length[Select[IntegerPartitions[Prime[n]],And[UnsameQ@@#,PrimeQ[Length[#]],And@@PrimeQ/@#]&]],{n,10}]
    (* Second program: *)
    h[n_] := h[n] = If[n == 0, 0, If[PrimeQ[n], n, h[n - 1]]];
    b[n_, i_, c_] := b[n, i, c] = If[n == 0,
         If[PrimeQ[c], 1, 0], If[i < 2, 0, b[n, h[i - 1], c] +
         If[i > n, 0, b[n - i, h[Min[n - i, i - 1]], c + 1]]]];
    a[n_] := b[Prime[n], Prime[n], 0];
    Array[a, 56] (* Jean-François Alcover, Jun 11 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(p=vector(n, k, prime(k))); my(v=Vec(prod(k=1, n, 1 + x^p[k]*y + O(x*x^p[n])))); vector(n, k, sum(i=1, k, polcoeff(v[1+p[k]], p[i])))} \\ Andrew Howroyd, Jun 26 2018

Formula

a(n) = A045450(A000040(n)).

Extensions

More terms from Alois P. Heinz, Jun 26 2018

A344782 Number of compositions of the n-th prime into a prime number of prime parts.

Original entry on oeis.org

0, 0, 2, 5, 11, 23, 119, 237, 776, 6665, 16518, 207953, 892680, 1824445, 8374988, 96208461, 978217302, 2059770725, 18616884428, 78013141907, 158103168924, 1386674113487, 6734724875544, 82189835767618, 2013603833805429, 9101106147506177, 19147196940580651
Offset: 1

Views

Author

Alois P. Heinz, May 28 2021

Keywords

Examples

			a(3) = 2: [2,3], [3,2].
a(4) = 5: [5,2], [2,5], [3,2,2], [2,3,2], [2,2,3].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, c) option remember; `if`(n=0, `if`(isprime(c),
          1, 0), add(`if`(isprime(j), b(n-j, c+1), 0), j=2..n))
        end:
    a:= n-> b(ithprime(n), 0):
    seq(a(n), n=1..31);
  • Mathematica
    b[n_, c_] := b[n, c] = If[n == 0, If[PrimeQ[c], 1, 0],
         Sum[If[PrimeQ[j], b[n - j, c + 1], 0], {j, 2, n}]];
    a[n_] := b[Prime[n], 0];
    Table[a[n], {n, 1, 31}] (* Jean-François Alcover, Apr 04 2022, after Alois P. Heinz *)

A343537 Number of partitions of the n-th Fibonacci number into a Fibonacci number of Fibonacci parts.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 7, 16, 41, 135, 632, 4091, 37020, 478852, 8897512, 240133480, 9489055662, 552854898873, 47794151866058, 6165361571608551, 1192709563056788508, 347571453153709529743, 153189847887607116894958
Offset: 0

Views

Author

Alois P. Heinz, May 26 2021

Keywords

Examples

			a(5) = 5: [5], [3,2], [3,1,1], [2,2,1], [1,1,1,1,1].  Partition [2,1,1,1] is not counted because 4 (the number of parts) is not a Fibonacci number.
a(6) = 7: [8], [5,3], [5,2,1], [3,3,2], [3,2,1,1,1], [2,2,2,1,1], [1,1,1,1,1,1,1,1].
a(7) = 16: [13], [8,5], [8,3,2], [8,2,1,1,1], [5,5,3], [5,5,1,1,1], [5,3,3,1,1], [5,3,2,2,1], [5,2,2,2,2], [5,2,1,1,1,1,1,1], [3,3,3,3,1], [3,3,3,2,2], [3,3,2,1,1,1,1,1], [3,2,2,2,1,1,1,1], [2,2,2,2,2,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1].
		

Crossrefs

Programs

  • Maple
    f:= n-> (t-> issqr(t+4) or issqr(t-4))(5*n^2):
    h:= proc(n) option remember; `if`(f(n), n, h(n-1)) end:
    b:= proc(n, i, c) option remember; `if`(n=0 or i=1, `if`(
          f(c+n), 1, 0), b(n-i, h(min(n-i, i)), c+1)+b(n, h(i-1), c))
        end:
    a:= n-> b((<<0|1>, <1|1>>^n)[1, 2]$2, 0):
    seq(a(n), n=0..17);
  • Mathematica
    $RecursionLimit = 10000;
    f[n_] := With[{t = 5 n^2}, IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4]];
    h[n_] := h[n] = If[f[n], n, h[n - 1]] ;
    b[n_, i_, c_] := b[n, i, c] = If[n == 0 || i == 1, If[f[c+n], 1, 0], b[n-i, h[Min[n-i, i]], c+1] + b[n, h[i-1], c]];
    a[n_] := a[n] = With[{m = MatrixPower[{{0, 1}, {1, 1}}, n][[1, 2]]}, b[m, m, 0]];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 17}] (* Jean-François Alcover, Sep 09 2022, after Alois P. Heinz *)

Formula

a(n) = Sum_{k in {A000045}} A319394(A000045(n),k).

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 *)
Showing 1-4 of 4 results.