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

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 *)

A341466 Number of partitions of n into 7 distinct nonprime parts.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 3, 6, 6, 9, 9, 14, 15, 21, 23, 30, 33, 43, 47, 61, 67, 81, 91, 112, 123, 150, 165, 194, 217, 255, 281, 330, 363, 417, 461, 529, 582, 665, 730, 823, 905, 1018, 1115, 1253, 1368, 1519, 1662, 1844, 2010, 2227, 2419, 2659, 2894, 3175, 3442
Offset: 50

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, 7):
    seq(a(n), n=50..105);  # 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, 7];
    Table[a[n], {n, 50, 105}] (* 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 *)

A358638 Number of partitions of n into at most 2 distinct nonprime parts.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Nov 24 2022

Keywords

Crossrefs

Programs

  • PARI
    A358638(n) = if(n<2,1,!isprime(n)+sum(k=1,(n-1)\2,!(isprime(k)+isprime(n-k)))); \\ Antti Karttunen, Nov 25 2022

Formula

For n > 0, a(n) = A005171(n) + A302479(n).

A337853 a(n) is the number of partitions of n as the sum of two Niven numbers.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 3, 4, 4, 4, 4, 5, 4, 5, 4, 4, 4, 3, 2, 4, 3, 3, 4, 3, 3, 5, 3, 4, 5, 4, 4, 7, 4, 5, 6, 5, 3, 7, 4, 4, 6, 4, 2, 7, 3, 4, 5, 4, 3, 7, 3, 4, 5, 4, 3, 8, 3, 4, 6, 3, 3, 6, 2, 5, 6, 5, 3, 8, 4, 4, 6
Offset: 0

Views

Author

Marius A. Burtea, Sep 26 2020

Keywords

Comments

a(n) >= 1 for n >= 2 ?.
For n <= 200000, a(n) = 1 only for n = 2, 3, 299, (2 = 1 + 1, 3 = 1 + 2, 299 = 1 + 288) and a(n) = 2 only for n in {4, 5, 35, 59, 79, 95, 97, 149, 169, 179, 389}.

Examples

			0 and 1 cannot be decomposed as the sum of two Niven numbers, so a(0) = a(1) = 0.
4 = 1 + 3 = 2 + 2 and 1, 2, 3 are in A005349, so a(4) = 2.
15 = 3 + 12 = 5 + 10 = 6 + 9 = 7 + 8 and 3, 5, 6, 7, 8, 9, 10, 12 are in A005349, so a(15) = 4.
		

Crossrefs

Programs

  • Magma
    niven:=func; [#RestrictedPartitions(n,2,{k: k in [1..n-1] | niven(k)}): n in [0..100]];
  • Mathematica
    m = 100; nivens = Select[Range[m], Divisible[#, Plus @@ IntegerDigits[#]] &]; a[n_] := Length[IntegerPartitions[n, {2}, nivens]]; Array[a, m, 0] (* Amiram Eldar, Sep 27 2020 *)

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