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.

A238403 Number of ways a number can be decomposed as a sum of the form pq + qr + rp where p < q < r are distinct primes.

This page as a plain text file.
%I A238403 #13 Feb 26 2014 17:12:29
%S A238403 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
%T A238403 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,
%U A238403 0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0
%N A238403 Number of ways a number can be decomposed as a sum of the form pq + qr + rp where p < q < r are distinct primes.
%C A238403 The average value of a(n) is >> sqrt(n)/log^3 n. - _Charles R Greathouse IV_, Feb 26 2014
%H A238403 Jean-François Alcover, <a href="/A238403/b238403.txt">Table of n, a(n) for n = 1..1000</a>
%e A238403 71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2, therefore a(71) = 2.
%t A238403 r[n_, p_] := Reduce[p < q < r && p*q+q*r+r*p == n, {q, r}, Primes]; a[n_] := (For[cnt = 0; p = 2, p <= Ceiling[(n-6)/5], p = NextPrime[p], rnp = r[n, p]; If[rnp =!= False, Which[rnp[[0]] === And, Print["n = ", n, " ", {p, q, r} /. ToRules[rnp]]; cnt++, rnp[[0]] === Or, Print["n = ", n, " ", {p, q, r} /. {ToRules[rnp]}]; cnt += Length[rnp], True, Print["error: n = ", n, " ", rnp]]]]; cnt); Table[a[n], {n, 1, 100}]
%o A238403 (PARI) list(n)=my(v=vector(n)); forprime(r=5,(n-6)\5, forprime(q=3, min((n-2*r)\(r+2),r-2), my(S=q+r,P=q*r); forprime(p=2,min((n-P)\S,q-1), v[p*S+P]++))); v \\ _Charles R Greathouse IV_, Feb 26 2014
%o A238403 (PARI) a(n)=my(s);forprime(r=(sqrtint(3*n-3)+5)\3,(n-6)\5, forprime(q= sqrtint(r^2+n)-r+1,min((n-2*r)\(r+2),r-2),if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)),s++)));s \\ _Charles R Greathouse IV_, Feb 26 2014
%Y A238403 Cf. A238403, A087053, A087054.
%K A238403 nonn
%O A238403 1,71
%A A238403 _Jean-François Alcover_, Feb 26 2014