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.

Previous Showing 11-20 of 23 results. Next

A347788 Number of compositions (ordered partitions) of n into at most 2 nonprime parts.

Original entry on oeis.org

1, 1, 1, 0, 1, 2, 1, 2, 2, 3, 5, 2, 4, 4, 5, 5, 8, 4, 8, 6, 8, 7, 11, 6, 12, 9, 13, 9, 14, 10, 16, 12, 14, 13, 19, 13, 22, 14, 17, 17, 22, 16, 24, 18, 22, 19, 25, 18, 28, 21, 28, 21, 28, 22, 32, 25, 30, 25, 33, 26, 38, 28, 31, 29, 38, 29, 42, 30, 34, 33, 42
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 13 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,2,Select[Range@n,!PrimeQ@#&]],1],{n,0,70}] (* Giorgos Kalogeropoulos, Sep 13 2021 *)
  • PARI
    A347788(n) = if(n<2,1,!isprime(n)+sum(k=1,n-1,!(isprime(k)+isprime(n-k)))); \\ Antti Karttunen, Nov 25 2022

A347796 Number of compositions (ordered partitions) of n into at most 3 nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 4, 2, 5, 6, 8, 11, 8, 13, 17, 17, 23, 25, 27, 33, 38, 37, 50, 48, 58, 63, 73, 70, 89, 82, 107, 102, 122, 112, 148, 136, 164, 161, 185, 173, 223, 196, 241, 231, 268, 254, 304, 273, 332, 318, 364, 348, 403, 364, 444, 415, 477, 448, 525, 479, 567
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 14 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,3,Select[Range@n,!PrimeQ@#&]],1],{n,0,60}] (* Giorgos Kalogeropoulos, Sep 14 2021 *)

A347797 Number of compositions (ordered partitions) of n into at most 4 nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 6, 5, 10, 14, 15, 24, 21, 35, 45, 48, 65, 77, 89, 114, 129, 148, 184, 205, 239, 285, 310, 361, 410, 459, 522, 593, 636, 740, 804, 911, 969, 1123, 1169, 1350, 1428, 1595, 1687, 1926, 1974, 2270, 2325, 2611, 2726, 3064, 3120, 3547, 3596, 4012, 4155
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 14 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,4,Select[Range@n,!PrimeQ@#&]],1],{n,0,55}] (* Giorgos Kalogeropoulos, Sep 14 2021 *)

A347798 Number of compositions (ordered partitions) of n into at most 5 nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 4, 6, 10, 10, 19, 25, 29, 46, 50, 75, 103, 110, 162, 194, 240, 309, 368, 444, 565, 654, 795, 960, 1106, 1325, 1560, 1792, 2118, 2436, 2785, 3244, 3691, 4194, 4783, 5419, 6121, 6893, 7780, 8617, 9766, 10790, 12060, 13340, 14851, 16231, 18210
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 14 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,5,Select[Range@n,!PrimeQ@#&]],1],{n,0,50}] (* Giorgos Kalogeropoulos, Sep 14 2021 *)

A347799 Number of compositions (ordered partitions) of n into at most 6 nonprime parts.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 6, 10, 16, 19, 31, 44, 52, 86, 101, 148, 206, 237, 350, 441, 551, 743, 900, 1151, 1470, 1782, 2216, 2762, 3287, 4072, 4894, 5835, 7052, 8362, 9856, 11758, 13710, 16066, 18791, 21799, 25271, 29192, 33583, 38485, 44178, 50304
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 14 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,6,Select[Range@n,!PrimeQ@#&]],1],{n,0,46}] (* Giorgos Kalogeropoulos, Sep 14 2021 *)

A353429 Number of integer compositions of n with all prime parts and all prime run-lengths.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 2, 0, 0, 1, 4, 0, 2, 2, 5, 4, 9, 1, 5, 12, 20, 11, 19, 18, 31, 43, 54, 37, 63, 95, 121, 124, 154, 178, 261, 353, 393, 417, 565, 770, 952, 1138, 1326, 1647, 2186, 2824, 3261, 3917, 4941, 6423, 7935, 9719, 11554, 14557, 18536, 23380, 27985
Offset: 0

Views

Author

Gus Wiseman, May 16 2022

Keywords

Examples

			The a(13) = 2 through a(16) = 9 compositions:
  (22333)  (77)       (555)     (3355)
  (33322)  (2255)     (33333)   (5533)
           (5522)     (222333)  (22255)
           (223322)   (333222)  (55222)
           (2222222)            (332233)
                                (2222233)
                                (2223322)
                                (2233222)
                                (3322222)
		

Crossrefs

The first condition only is A023360, partitions A000607.
For partitions we have A351982, only run-lens A100405, only parts A008483.
The second condition only is A353401, partitions A055923.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A052284 counts compositions into nonprimes, partitions A002095.
A106356 counts compositions by number of adjacent equal parts.
A114901 counts compositions with no runs of length 1, ranked by A353427.
A329738 counts uniform compositions, partitions A047966.

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1, add(`if`(i<>h and isprime(i),
          add(`if`(isprime(j), b(n-i*j, i), 0), j=2..n/i), 0), i=2..n/2))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..70);  # Alois P. Heinz, May 18 2022
  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], And@@PrimeQ/@#&&And@@PrimeQ/@Length/@Split[#]&]],{n,0,15}]

Extensions

a(26)-a(56) from Alois P. Heinz, May 18 2022

A157423 Triangle read by rows, T(n,k) = 0 if (n-k+1) is prime, else 1.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1
Offset: 1

Views

Author

Gary W. Adamson & Mats Granvik, Feb 28 2009

Keywords

Comments

Row sums = A062298: (1, 1, 1, 2, 2, 3, 3, 4, 5, 6,...). Eigensequence of the triangle = A052284: (1, 1, 1, 2, 3, 5, 7, 11, 17, 27,...).

Examples

			First few rows of the triangle =
1;
0, 1;
0, 0, 1;
1, 0, 0, 1;
0, 1, 0, 0, 1;
1, 0, 1, 0, 0, 1;
0, 1, 0, 1, 0, 0, 1;
1, 0, 1, 0, 1, 0, 0, 1;
1, 1, 0, 1, 0, 1, 0, 0, 1;
1, 1, 1, 0, 1, 0, 1, 0, 0, 1;
0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1;
1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1;
0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1;
1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1;
...
Example: T(6,4) = 0 since (6 - 4 + 1) = 3, prime.
		

Crossrefs

Programs

  • Mathematica
    Table[If[PrimeQ[n-k+1],0,1],{n,15},{k,n}]//Flatten (* Harvey P. Dale, Jul 19 2016 *)

Formula

Triangle read by rows, T(n,k) = 0 if (n-k+1) is prime, else 1. By columns, A005171 in every column: where A005171(k) = 0 if k is prime.

A276421 Number of palindromic compositions of n into nonprime numbers.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 1, 5, 3, 7, 4, 11, 6, 16, 9, 25, 14, 38, 21, 59, 34, 89, 50, 137, 77, 208, 117, 319, 180, 486, 273, 744, 420, 1134, 639, 1735, 977, 2648, 1491, 4048, 2281, 6180, 3480, 9444, 5321, 14421, 8122, 22035, 12412, 33655, 18957, 51417, 28966
Offset: 0

Views

Author

Emeric Deutsch, Sep 03 2016

Keywords

Examples

			a(6) = 3 because we have [6], [1,4,1], and [1,1,1,1,1,1].
a(10) = 7 because we have [10], [1,8,1], [1,1,6,1,1], [1,4,4,1], [4,1,1,4], [1,1,1,4,1,1,1], and [1^{10}].
		

Crossrefs

Programs

  • Maple
    F:=sum(z^j,j=1..229)-(sum(z^ithprime(k),k=1..50)): g:=(1+F)/(1-subs(z = z^2, F)): gser:=series(g,z=0,53): seq(coeff(gser,z,n),n=0..50);
    # second Maple program:
    a:= proc(n) option remember; `if`(isprime(n), 0, 1)+
          add(`if`(isprime(j), 0, a(n-2*j)), j=1..n/2)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Sep 03 2016
  • Mathematica
    a[n_] := a[n] = If[PrimeQ[n], 0, 1] + Sum[If[PrimeQ[j], 0, a[n-2j]], {j, 1, n/2}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Feb 08 2017, after Alois P. Heinz *)

Formula

G.f.: g(z)=(1+F(z))/(1-F(z^2)), where F(z)=Sum_{m nonprime} z^m = z + z^4 + z^6 + z^8 + z^9 + z^10 + z^12 + ... is the g.f. of A005171.

A280544 Expansion of 1/(1 - Sum_{k>=2} (1 - floor(2/d(k)))*x^k), where d(k) is the number of divisors (A000005).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 3, 0, 5, 2, 8, 3, 13, 5, 22, 10, 34, 18, 58, 31, 94, 57, 153, 99, 254, 172, 417, 302, 685, 523, 1136, 901, 1872, 1557, 3097, 2673, 5133, 4577, 8505, 7843, 14109, 13380, 23440, 22816, 38953, 38855, 64789, 66053, 107871, 112190, 179664, 190369, 299478, 322683, 499501, 546548
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 05 2017

Keywords

Comments

Number of compositions (ordered partitions) of n into composite parts (A002808).

Examples

			a(10) = 3 because we have [10], [6, 4] and [4, 6].
		

Crossrefs

Programs

  • Mathematica
    nmax = 59; CoefficientList[Series[1/(1 - Sum[(1 - Floor[2/DivisorSigma[0, k]]) x^k, {k, 2, nmax}]), {x, 0, nmax}], x]
  • PARI
    x='x+O('x^60); Vec(1/(1 - sum(k=2, 59, (1 - 2\numdiv(k))*x^k))) \\ Indranil Ghosh, Apr 03 2017

Formula

G.f.: 1/(1 - Sum_{k>=2} (1 - floor(2/d(k)))*x^k).

A331917 Number of compositions (ordered partitions) of n into distinct nonprime parts.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 1, 2, 1, 3, 5, 8, 3, 10, 11, 17, 13, 16, 19, 54, 49, 55, 59, 90, 89, 129, 127, 183, 307, 358, 351, 456, 553, 649, 889, 1015, 1143, 1490, 2219, 1913, 3021, 3394, 4241, 4944, 6663, 6859, 9337, 9522, 12123, 14895, 22425, 18849, 28341, 31468, 41533
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 01 2020

Keywords

Examples

			a(10) = 5 because we have [10], [9, 1], [6, 4], [4, 6] and [1, 9].
		

Crossrefs

Previous Showing 11-20 of 23 results. Next