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

A117278 Triangle read by rows: T(n,k) is the number of partitions of n into k prime parts (n>=2, 1<=k<=floor(n/2)).

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Mar 07 2006

Keywords

Comments

Row n has floor(n/2) terms. Row sums yield A000607. T(n,1) = A010051(n) (the characteristic function of the primes). T(n,2) = A061358(n). Sum(k*T(n,k), k>=1) = A084993(n).

Examples

			T(12,3) = 2 because we have [7,3,2] and [5,5,2].
Triangle starts:
  1;
  1;
  0, 1;
  1, 1;
  0, 1, 1;
  1, 1, 1;
  0, 1, 1, 1;
  0, 1, 2, 1;
  ...
		

Crossrefs

Row sums give A000607.
T(A000040(n),n) gives A259254(n).

Programs

  • Maple
    g:=1/product(1-t*x^(ithprime(j)),j=1..30): gser:=simplify(series(g,x=0,30)): for n from 2 to 22 do P[n]:=sort(coeff(gser,x^n)) od: for n from 2 to 22 do seq(coeff(P[n],t^j),j=1..floor(n/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, i) option remember;
          `if`(n=0, [1], `if`(i<1, [], zip((x, y)->x+y, b(n, i-1),
           [0, `if`(ithprime(i)>n, [], b(n-ithprime(i), i))[]], 0)))
        end:
    T:= n-> subsop(1=NULL, b(n, numtheory[pi](n)))[]:
    seq(T(n), n=2..25);  # Alois P. Heinz, Nov 16 2012
  • Mathematica
    (* As triangle: *) nn=20;a=Product[1/(1-y x^i),{i,Table[Prime[n],{n,1,nn}]}];Drop[CoefficientList[Series[a,{x,0,nn}],{x,y}],2,1]//Grid (* Geoffrey Critzer, Oct 30 2012 *)
  • PARI
    parts(n, pred)={prod(k=1, n, if(pred(k), 1/(1-y*x^k) + O(x*x^n), 1))}
    {my(n=15); apply(p->Vecrev(p/y), Vec(parts(n, isprime)-1))} \\ Andrew Howroyd, Dec 28 2017

Formula

G.f.: G(t,x) = -1+1/product(1-tx^(p(j)), j=1..infinity), where p(j) is the j-th prime.

A319435 Number of partitions of n^2 into exactly n nonzero squares.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 4, 4, 9, 16, 24, 52, 83, 152, 305, 515, 959, 1773, 3105, 5724, 10255, 18056, 32584, 58082, 101719, 179306, 317610, 552730, 962134, 1683435, 2899064, 4995588, 8638919, 14746755, 25196684, 43082429, 72959433, 123554195, 209017908, 351164162
Offset: 0

Views

Author

Alois P. Heinz, Sep 18 2018

Keywords

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 0: there is no partition of 4 into exactly 2 nonzero squares.
a(3) = 1: 441.
a(4) = 1: 4444.
a(5) = 1: 94444.
a(6) = 4: (25)44111, (16)(16)1111, (16)44444, 999441.
a(7) = 4: (25)(16)41111, (25)444444, (16)(16)44441, (16)999411.
a(8) = 9: (49)9111111, (36)(16)441111, (36)4444444, (25)(25)911111, (25)(16)944411, (25)9999111, (16)(16)(16)94111, (16)9999444, 99999991.
		

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(issqr(n), n, h(n-1)))
        end:
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1 or
          t<1, 0, b(n, h(i-1), t)+b(n-i, h(min(n-i, i)), t-1)))
        end:
    a:= n-> (s-> b(s$2, n)-`if`(n=0, 0, b(s$2, n-1)))(n^2):
    seq(a(n), n=0..40);
  • Mathematica
    h[n_] := h[n] = If[n < 1, 0, If[Sqrt[n] // IntegerQ, n, h[n - 1]]];
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, 1, If[i < 1 || t < 1, 0, b[n, h[i - 1], t] + b[n - i, h[Min[n - i, i]], t - 1]]];
    a[n_] := Function[s, b[s, s, n] - If[n == 0, 0, b[s, s, n - 1]]][n^2];
    a /@ Range[0, 40] (* Jean-François Alcover, Nov 06 2020, after Alois P. Heinz *)
  • SageMath
    # uses[GeneralizedEulerTransform(n, a) from A338585], slow.
    def A319435List(n): return GeneralizedEulerTransform(n, lambda n: n^2)
    print(A319435List(10)) # Peter Luschny, Nov 12 2020

Formula

a(n) = A243148(n^2,n).

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.

A319503 Number of partitions of Fibonacci(n) into exactly n positive Fibonacci numbers.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 2, 6, 16, 43, 117, 305, 769, 1907, 4686, 11587, 28580, 70451, 172880, 423629, 1036332, 2533559, 6186635, 15092985, 36784586, 89590410, 218069921, 530551804, 1290218120, 3136385254, 7621522229, 18515039477, 44966884766, 109184448962
Offset: 0

Views

Author

Alois P. Heinz, Sep 20 2018

Keywords

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(5) = 1: 11111.
a(6) = 2: 221111, 311111.
a(7) = 6: 2222221, 3222211, 3322111, 3331111, 5221111, 5311111.
		

Crossrefs

Programs

  • Mathematica
    (* Program not suitable for a large number of terms. *)
    a[n_] := a[n] = If[n < 2, 1, IntegerPartitions[Fibonacci[n], {n}, Fibonacci[Range[2, n - 1]]] //Length];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 24}] (* Jean-François Alcover, Dec 08 2020 *)

Formula

a(n) = [x^A000045(n) y^n] 1/Product_{j>=2} (1-y*x^A000045(j)).
a(n) = A319394(A000045(n),n).

A301971 a(n) = [x^n] Product_{k>=1} 1/(1 - x^prime(k))^n.

Original entry on oeis.org

1, 0, 2, 3, 10, 30, 77, 252, 682, 2136, 6182, 18766, 56173, 169351, 512990, 1551828, 4720170, 14348289, 43751984, 133502873, 408029510, 1248460587, 3823949824, 11724787763, 35980251181, 110510334780, 339674840715, 1044812449722, 3215861978150, 9904301974294, 30521063942312, 94103983534015
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 29 2018

Keywords

Comments

Number of partitions of n into prime parts of n kinds.

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - x^Prime[k])^n, {k, 1, n}], {x, 0, n}], {n, 0, 31}]

A376348 a(n) is the number of multisets with n primes with which an n-gon with perimeter prime(n) can be formed.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 7, 7, 12, 19, 19, 25, 44, 72, 72, 119, 147, 152, 234, 292, 435, 777, 920, 946, 1135, 1161, 1377, 3702, 4293, 5942, 5942, 10741, 10741, 14483, 18953, 22091, 28658, 37686, 37686, 63053, 63053, 72389, 72389, 132732, 233773, 265312, 265312, 300443, 373266
Offset: 3

Views

Author

Felix Huber, Oct 13 2024

Keywords

Comments

a(n) is the number of partitions of prime(n) into n prime parts < prime(n)/2.
First differs from A259254 at n=31: a(31) = 3702 but A259254(31) = 3703.

Examples

			a(7) = 2 because exactly the 2 partitions (2, 2, 2, 2, 3, 3, 3) and (2, 2, 2, 2, 2, 2, 5) have 7 prime parts and their sum is p(7) = 17.
		

Crossrefs

Programs

  • Maple
    A376348:=proc(n)
       local a,p,x,i;
       a:=0;
       p:=ithprime(n);
       for x from NumberTheory:-pi(p/n)+1 to NumberTheory:-pi(p/2) do
          a:=a+numelems(select(i->nops(i)=n-1 and andmap(isprime,i),combinat:-partition(ithprime(n)-ithprime(x),ithprime(x))))
       od;
       return a
    end proc;
    seq(A376348(n),n=3..42);
  • PARI
    a(n)={my(m=prime(n), p=primes(primepi((m-1)\2))); polcoef(polcoef(1/prod(i=1, #p, 1 - y*x^p[i], 1 + O(x*x^m)), m),n)} \\ Andrew Howroyd, Oct 13 2024

Extensions

a(43) onwards from Andrew Howroyd, Oct 13 2024
Showing 1-6 of 6 results.