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.

A243940 Number of partitions of n^2 into exactly 4 prime numbers.

This page as a plain text file.
%I A243940 #10 Apr 15 2015 10:02:23
%S A243940 0,0,1,3,5,15,13,50,24,126,50,258,78,508,115,899,176,1562,240,2383,
%T A243940 299,3616,440,5733,547,7585,664,10705,863,16259,1033,19591,1234,25943,
%U A243940 1566,37879,1860,43405,1976,55700,2529,78989,2942,86261,3162,106212,3867,148771
%N A243940 Number of partitions of n^2 into exactly 4 prime numbers.
%H A243940 Alois P. Heinz, <a href="/A243940/b243940.txt">Table of n, a(n) for n = 1..100</a>
%p A243940 with(numtheory):
%p A243940 b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
%p A243940       `if`(i<1 or t<1, 0, b(n, i-1, t) +(p-> `if`(p>n, 0,
%p A243940          b(n-p, i, t-1)))(ithprime(i))))
%p A243940     end:
%p A243940 a:= n-> b(n^2, pi(n^2), 4):
%p A243940 seq(a(n), n=1..40);  # _Alois P. Heinz_, Jun 15 2014
%t A243940 $RecursionLimit = 1000; 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] + Function[{p}, If[p > n, 0, b[n - p, i, t - 1]]][Prime[i]]]]; a[n_] := b[n^2, PrimePi[n^2], 4]; Table[a[n], {n, 1, 40}] (* _Jean-François Alcover_, Apr 15 2015, after _Alois P. Heinz_ *)
%K A243940 nonn
%O A243940 1,4
%A A243940 _Olivier Gérard_, Jun 15 2014