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-9 of 9 results.

A302479 Number of partitions of n into two distinct nonprime parts.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 5, 3, 5, 4, 6, 4, 6, 5, 7, 6, 6, 6, 9, 6, 10, 7, 8, 8, 10, 8, 11, 9, 10, 9, 12, 9, 13, 10, 13, 10, 13, 11, 15, 12, 14, 12, 16, 13, 18, 14, 15, 14, 18, 14, 20, 15, 16, 16, 20, 16, 21, 17, 20, 17
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 08 2018

Keywords

Examples

			a(16) = 3; 16 = 15+1 = 12+4 = 10+6, which are distinct nonprimes.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(1 - PrimePi[n - i] + PrimePi[n - i - 1]) (1 - PrimePi[i] + PrimePi[i - 1]), {i, Floor[(n - 1)/2]}], {n, 100}]
    Table[Length[Select[IntegerPartitions[n,{2}],Length[Union[#]]==2&&Boole[PrimeQ[#]]=={0,0}&]],{n,80}] (* Harvey P. Dale, Dec 28 2023 *)
  • PARI
    A302479(n) = sum(k=1,(n-1)\2,!(isprime(k)+isprime(n-k))); \\ Antti Karttunen, Nov 25 2022

Formula

a(n) = Sum_{i=1..floor((n-1)/2)} (1 - c(i)) * (1 - c(n-i)), where c = A010051.
For n > 0, a(n) = A358638(n) - A005171(n). - Antti Karttunen, Nov 25 2022

A341461 Number of partitions of n into 3 distinct nonprime parts.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 2, 2, 4, 3, 4, 4, 6, 5, 8, 7, 9, 9, 10, 12, 14, 14, 14, 17, 19, 19, 22, 23, 24, 28, 27, 31, 33, 35, 36, 40, 40, 44, 47, 49, 50, 55, 53, 61, 62, 66, 65, 73, 72, 79, 81, 86, 85, 95, 91, 101, 101, 109, 107, 119, 114, 125, 125, 134, 134
Offset: 11

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
        end:
    a:= n-> b(n$2, 3):
    seq(a(n), n=11..75);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
    a[n_] := b[n, n, 3];
    a /@ Range[11, 75] (* Jean-François Alcover, Jul 01 2021, after Alois P. Heinz *)
  • Python
    from functools import lru_cache
    from sympy import isprime
    @lru_cache(maxsize=None)
    def b(n, i, t):
      if n == 0: return int(t == 0)
      if i < 1 or t < 1: return 0
      b2 = 0 if isprime(i) else b(n-i, min(n-i, i-1), t-1)
      return b(n, i-1, t) + b2
    a = lambda n: b(n, n, 3)
    print([a(n) for n in range(11, 76)]) # Michael S. Branicky, Feb 12 2021 after Alois P. Heinz

A341462 Number of partitions of n into 4 distinct nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 6, 10, 9, 13, 12, 17, 17, 21, 21, 28, 28, 34, 33, 42, 43, 51, 53, 61, 63, 73, 76, 87, 91, 102, 104, 119, 123, 137, 143, 157, 164, 179, 187, 205, 215, 232, 239, 262, 272, 294, 309, 327, 341, 365, 381, 406, 427, 448, 465
Offset: 19

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
        end:
    a:= n-> b(n$2, 4):
    seq(a(n), n=19..78);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
    a[n_] := b[n, n, 4];
    Table[a[n], {n, 19, 78}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *)
    Table[Length[Select[IntegerPartitions[n,{4}],Length[#]==Length[ Union[ #]] && NoneTrue[#,PrimeQ]&]],{n,19,80}] (* Harvey P. Dale, Nov 07 2021 *)

A341464 Number of partitions of n into 5 distinct nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 4, 5, 7, 7, 9, 12, 14, 15, 19, 21, 27, 29, 35, 38, 47, 49, 59, 65, 77, 82, 96, 102, 119, 128, 147, 157, 181, 189, 216, 231, 260, 276, 309, 327, 366, 387, 431, 454, 505, 529, 584, 617, 678, 713, 780, 818, 892, 938, 1020, 1071, 1164, 1213, 1311, 1378
Offset: 28

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
        end:
    a:= n-> b(n$2, 5):
    seq(a(n), n=28..88);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
    a[n_] := b[n, n, 5];
    Table[a[n], {n, 28, 88}] (* Jean-François Alcover, Jul 13 2021, after Alois P. Heinz *)

A341465 Number of partitions of n into 6 distinct nonprime parts.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 3, 6, 5, 8, 10, 13, 13, 18, 20, 26, 30, 36, 40, 49, 55, 65, 76, 88, 97, 114, 128, 146, 167, 187, 209, 237, 262, 294, 331, 366, 405, 449, 496, 547, 608, 663, 730, 798, 875, 953, 1050, 1136, 1239, 1342, 1463, 1577, 1723, 1849, 2008, 2159, 2334
Offset: 38

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i b(n$2, 6):
    seq(a(n), n=38..95);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1], 0]]];
    a[n_] := b[n, n, 6];
    Table[a[n], {n, 38, 95}] (* Jean-François Alcover, Feb 23 2022, after Alois P. Heinz *)

A341467 Number of partitions of n into 8 distinct nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 5, 6, 7, 10, 12, 16, 19, 24, 28, 36, 41, 52, 60, 73, 85, 102, 116, 142, 161, 192, 217, 256, 287, 339, 382, 442, 496, 574, 639, 737, 821, 937, 1041, 1184, 1309, 1483, 1640, 1845, 2037, 2283, 2508, 2807, 3081, 3430, 3761, 4170, 4553, 5045
Offset: 64

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(isprime(i), 0, b(n-i, min(n-i, i-1), t-1))))
        end:
    a:= n-> b(n$2, 8):
    seq(a(n), n=64..118);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1], 0]]];
    a[n_] := b[n, n, 8];
    Table[a[n], {n, 64, 118}] (* Jean-François Alcover, Feb 22 2022, after Alois P. Heinz *)

A341484 Number of ways to write n as an ordered sum of 7 nonprime numbers.

Original entry on oeis.org

1, 0, 0, 7, 0, 7, 21, 7, 49, 42, 63, 154, 119, 259, 357, 420, 707, 861, 1169, 1666, 2072, 2752, 3703, 4557, 5999, 7637, 9422, 12089, 14931, 18354, 22904, 27825, 33866, 41328, 49539, 59753, 71386, 85071, 100800, 119455, 140448, 164794, 193179, 224826, 261464, 303422
Offset: 7

Views

Author

Ilya Gutkovskiy, Feb 13 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add(
          `if`(isprime(j), 0, b(n-j, t-1)), j=1..n)))
        end:
    a:= n-> b(n, 7):
    seq(a(n), n=7..52);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    nmax = 52; CoefficientList[Series[Sum[Boole[!PrimeQ[k]] x^k, {k, 1, nmax}]^7, {x, 0, nmax}], x] // Drop[#, 7] &

A341468 Number of partitions of n into 9 distinct nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 5, 6, 7, 11, 12, 18, 20, 25, 30, 38, 45, 57, 67, 81, 95, 114, 133, 162, 187, 219, 255, 297, 343, 401, 462, 529, 607, 696, 793, 910, 1032, 1168, 1324, 1497, 1689, 1905, 2142, 2400, 2692, 3009, 3362, 3754, 4182, 4643, 5165
Offset: 79

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i b(n$2, 9):
    seq(a(n), n=79..130);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1], 0]]];
    a[n_] := b[n, n, 9];
    Table[a[n], {n, 79, 130}] (* Jean-François Alcover, Feb 28 2022, after Alois P. Heinz *)

A341469 Number of partitions of n into 10 distinct nonprime parts.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 3, 6, 7, 10, 11, 17, 17, 25, 28, 38, 44, 57, 64, 82, 95, 117, 136, 168, 189, 231, 264, 317, 366, 433, 490, 579, 660, 770, 877, 1019, 1146, 1327, 1497, 1720, 1940, 2215, 2481, 2825, 3165, 3583, 4008, 4523, 5033, 5664
Offset: 95

Views

Author

Ilya Gutkovskiy, Feb 12 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0,
          `if`(t=0, 1, 0), `if`(i b(n$2, 10):
    seq(a(n), n=95..145);  # Alois P. Heinz, Feb 12 2021
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0,
         If[t == 0, 1, 0], If[i < t || t < 1, 0, b[n, i - 1, t] +
         If[PrimeQ[i], 0, b[n - i, Min[n - i, i - 1], t - 1]]]];
    a[n_] := b[n, n, 10];
    Table[a[n], {n, 95, 145}] (* Jean-François Alcover, Feb 28 2022, after Alois P. Heinz *)
Showing 1-9 of 9 results.