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 43 results. Next

A347743 Number of compositions (ordered partitions) of n into at most 6 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 6, 6, 10, 16, 20, 35, 46, 71, 98, 130, 182, 226, 295, 359, 430, 534, 626, 746, 880, 1019, 1196, 1392, 1574, 1815, 2063, 2313, 2655, 2941, 3275, 3669, 4017, 4441, 4917, 5295, 5852, 6365, 6957, 7575, 8198, 8839, 9511, 10374, 10958, 11931
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 11 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,6,Prime@Range@PrimePi@n],1],{n,0,50}] (* Giorgos Kalogeropoulos, Sep 12 2021 *)

Formula

a(n) = Sum_{k=1..6} A121303(n,k) for n >= 2. - Alois P. Heinz, Sep 11 2021

A121304 Number of parts in all the compositions of n into primes (i.e., in all ordered sequences of primes having sum n).

Original entry on oeis.org

1, 1, 2, 5, 5, 14, 17, 32, 53, 76, 139, 198, 334, 515, 798, 1280, 1938, 3075, 4710, 7299, 11298, 17296, 26738, 40874, 62763, 96036, 146674, 224210, 341562, 520767, 792375, 1204951, 1831124, 2779234, 4217008, 6391663, 9683056, 14659038, 22177341
Offset: 2

Views

Author

Emeric Deutsch, Aug 06 2006

Keywords

Comments

a(n) = Sum_{k=1..floor(n/2)} k*A121303(n,k).

Examples

			a(8) = 17 because the compositions of 8 into primes are [3,5], [5,3], [2,3,3], [3,2,3], [3,3,2] and [2,2,2,2], having a total of 2+2+3+3+3+4 = 17 parts.
		

Crossrefs

Programs

  • Maple
    g:=sum(z^ithprime(i),i=1..53)/(1-sum(z^ithprime(i),i=1..53))^2: gser:=series(g,z=0,48): seq(coeff(gser,z,n),n=2..45);
    # second Maple program:
    b:= proc(n) option remember; `if`(n=0, [1, 0], add(
          `if`(isprime(j), (p->p+[0, p[1]])(b(n-j)), 0), j=1..n))
        end:
    a:= n-> b(n)[2]:
    seq(a(n), n=2..50);  # Alois P. Heinz, Nov 08 2013, revised Feb 12 2021
  • Mathematica
    nn=40;a[x_]:=Sum[x^Prime[n],{n,1,nn}];Drop[CoefficientList[Series[D[1/(1-y a[x]),y]/.y ->1,{x,0,nn}],x],2] (* Geoffrey Critzer, Nov 08 2013 *)
    Table[Length[Flatten[Union[Flatten[Permutations/@Select[ IntegerPartitions[ n], AllTrue[ #,PrimeQ]&],1]]]],{n,2,40}] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 24 2016 *)
    b[n_] := b[n] = If[n == 0, {1, 0}, Sum[If[PrimeQ[j],
         Function[p, p+{0, p[[1]]}][b[n-j]], {0, 0}], {j, 1, n}]];
    a[n_] := b[n][[2]];
    a /@ Range[2, 50] (* Jean-François Alcover, Jun 01 2021, after Alois P. Heinz *)

Formula

G.f.: (Sum_{i>=1} z^prime(i))/(1 - Sum_{i>=1} z^prime(i))^2.

A347739 Number of compositions (ordered partitions) of n into at most 2 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 1, 3, 2, 2, 3, 1, 2, 3, 3, 2, 4, 1, 4, 3, 4, 2, 5, 1, 6, 2, 5, 0, 4, 1, 6, 3, 4, 2, 7, 0, 8, 1, 3, 2, 6, 1, 8, 3, 6, 2, 7, 1, 10, 2, 8, 0, 6, 1, 10, 2, 6, 0, 7, 1, 12, 3, 5, 2, 10, 0, 12, 1, 4, 2, 10, 1, 12, 3, 9, 2, 10, 0, 14, 1, 8
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 11 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,2,Prime@Range@PrimePi@n],1],{n,0,100}] (* Giorgos Kalogeropoulos, Sep 12 2021 *)

Formula

a(n) = Sum_{k=1..2} A121303(n,k) for n >= 2. - Alois P. Heinz, Sep 11 2021

A347740 Number of compositions (ordered partitions) of n into at most 3 prime parts.

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 6, 5, 6, 9, 7, 11, 9, 9, 12, 13, 13, 16, 15, 16, 21, 17, 22, 21, 23, 23, 30, 19, 31, 18, 33, 22, 39, 19, 39, 29, 43, 27, 48, 15, 52, 26, 51, 30, 56, 25, 67, 31, 62, 38, 67, 30, 82, 28, 77, 36, 79, 25, 88, 33, 90, 41, 95, 25, 105, 42, 106, 40, 99, 22
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 11 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@Flatten[Permutations/@IntegerPartitions[n,3,Prime@Range@PrimePi@n],1],{n,0,70}] (* Giorgos Kalogeropoulos, Sep 12 2021 *)

Formula

a(n) = Sum_{k=1..3} A121303(n,k) for n >= 2. - Alois P. Heinz, Sep 11 2021

A299168 Number of ordered ways of writing n-th prime number as a sum of n primes.

Original entry on oeis.org

1, 0, 0, 0, 5, 6, 42, 64, 387, 5480, 10461, 113256, 507390, 1071084, 4882635, 44984560, 382362589, 891350154, 7469477771, 33066211100, 78673599501, 649785780710, 2884039365010, 22986956007816, 306912836483025, 1361558306986280, 3519406658042964
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 04 2018

Keywords

Examples

			a(5) = 5 because fifth prime number is 11 and we have [3, 2, 2, 2, 2], [2, 3, 2, 2, 2], [2, 2, 3, 2, 2], [2, 2, 2, 3, 2] and [2, 2, 2, 2, 3].
		

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), b(n-j, t-1), 0), j=1..n)))
        end:
    a:= n-> b(ithprime(n), n):
    seq(a(n), n=1..30);  # Alois P. Heinz, Feb 13 2021
  • Mathematica
    Table[SeriesCoefficient[Sum[x^Prime[k], {k, 1, n}]^n, {x, 0, Prime[n]}], {n, 1, 27}]

Formula

a(n) = [x^prime(n)] (Sum_{k>=1} x^prime(k))^n.

A300703 Number of compositions (ordered partitions) of n into prime parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 5, 2, 5, 2, 19, 2, 45, 6, 10, 14, 231, 4, 500, 14, 48, 45, 2351, 12, 1520, 144, 637, 100, 24441, 6, 53242, 810, 2558, 1294, 15402, 94, 550862, 3707, 16658, 680, 2616337, 53, 5701552, 11639, 6606, 30749, 27077004, 800, 21212965, 5215, 611097, 109818, 280237216
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2018

Keywords

Examples

			a(9) = 5 because we have [7, 2], [5, 2, 2], [2, 7], [2, 5, 2] and [2, 2, 5].
		

Crossrefs

Programs

  • Maple
    a:= proc(m) option remember; local b; b:= proc(n) option
          remember; `if`(n=0, 1, add(`if`(not isprime(j) or
           irem(m, j)=0, 0, b(n-j)), j=2..n)) end; b(m)
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, Mar 11 2018
  • Mathematica
    Table[SeriesCoefficient[1/(1 - Sum[Boole[Mod[n, k] != 0 && PrimeQ[k]] x^k, {k, 1, n}]), {x, 0, n}], {n, 0, 53}]

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

A284463 Number of compositions (ordered partitions) of n into prime divisors of n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 12, 1, 2, 2, 1, 1, 65, 1, 23, 2, 2, 1, 351, 1, 2, 1, 38, 1, 15778, 1, 1, 2, 2, 2, 10252, 1, 2, 2, 1601, 1, 302265, 1, 80, 750, 2, 1, 299426, 1, 13404, 2, 107, 1, 1618192, 2, 5031, 2, 2, 1, 707445067, 1, 2, 2398, 1, 2, 119762253, 1, 173, 2, 39614048, 1, 255418101, 1, 2, 154603
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

			a(6) = 2 because 6 has 4 divisors {1, 2, 3, 6} among which 2 are primes {2, 3} therefore we have [3, 3] and [2, 2, 2].
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local b, l;
          l, b:= numtheory[factorset](n),
          proc(m) option remember; `if`(m=0, 1,
             add(`if`(j>m, 0, b(m-j)), j=l))
          end; b(n)
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 28 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[PrimeQ[d[[k]]]] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 75}]
  • Python
    from sympy import divisors, isprime
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if isprime(x)]
        @cacheit
        def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
        return b(n)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Aug 01 2017, after Maple code

Formula

a(n) = [x^n] 1/(1 - Sum_{p|n, p prime} x^p).
a(n) = 1 if n is a prime power > 1.
a(n) = 2 if n is a squarefree semiprime.

A301428 Number of compositions (ordered partitions) of n into prime parts such that no two adjacent parts are equal (Carlitz compositions).

Original entry on oeis.org

1, 0, 1, 1, 0, 3, 0, 4, 3, 3, 10, 3, 16, 12, 18, 35, 24, 64, 57, 90, 137, 136, 259, 270, 416, 573, 679, 1088, 1264, 1869, 2491, 3199, 4691, 5834, 8341, 11053, 14685, 20595, 26636, 37199, 49449, 66572, 91377, 120733, 166151, 221912, 300038, 407775, 544843, 743318, 996752
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 21 2018

Keywords

Examples

			a(7) = 4 because we have [7], [5, 2], [2, 5] and [2, 3, 2].
		

Crossrefs

Programs

  • Mathematica
    nmax = 50; CoefficientList[Series[1/(1 - Sum[x^Prime[k]/(1 + x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: 1/(1 - Sum_{k>=1} x^prime(k)/(1 + x^prime(k))).

A331981 Number of compositions (ordered partitions) of n into distinct odd primes.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 1, 2, 0, 2, 1, 2, 1, 2, 6, 4, 1, 4, 7, 4, 12, 4, 13, 6, 12, 28, 18, 28, 19, 6, 25, 52, 24, 54, 30, 56, 31, 98, 156, 102, 37, 104, 157, 150, 276, 150, 175, 154, 288, 200, 528, 246, 307, 226, 666, 990, 780, 1038, 679, 348, 799, 1828, 1272, 1162, 1164
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 03 2020

Keywords

Examples

			a(16) = 4 because we have [13, 3], [11, 5], [5, 11] and [3, 13].
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<1, 0, ithprime(n+1)+s(n-1)) end:
    b:= proc(n, i, t) option remember; `if`(s(i)`if`(p>n, 0, b(n-p, i-1, t+1)))(ithprime(i+1))+b(n, i-1, t)))
        end:
    a:= n-> b(n, numtheory[pi](n), 0):
    seq(a(n), n=0..72);  # Alois P. Heinz, Feb 03 2020
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, Prime[n + 1] + s[n - 1]];
    b[n_, i_, t_] := b[n, i, t] = If[s[i] < n, 0, If[n == 0, t!, If[# > n, 0, b[n - #, i - 1, t + 1]]&[Prime[i + 1]] + b[n, i - 1, t]]];
    a[n_] := b[n, PrimePi[n], 0];
    a /@ Range[0, 72] (* Jean-François Alcover, Nov 09 2020, after Alois P. Heinz *)
Previous Showing 11-20 of 43 results. Next