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.

A103558 Semiprimes of the form p^2 + q^2, where p and q are primes.

This page as a plain text file.
%I A103558 #15 Nov 04 2017 06:58:23
%S A103558 34,58,74,146,178,194,218,298,314,365,386,458,482,533,538,554,698,818,
%T A103558 866,965,1082,1202,1322,1418,1538,1658,1685,1706,1853,1858,1874,2018,
%U A103558 2042,2138,2218,2234,2258,2498,2642,2813,2818,2858,2978,3098,3218,3338
%N A103558 Semiprimes of the form p^2 + q^2, where p and q are primes.
%C A103558 p and q must be distinct, otherwise p^2 + q^2 = 2*p*p has three prime factors. - _Klaus Brockhaus_
%C A103558 Even terms are 2*A103739. - _Robert Israel_, Nov 03 2017
%H A103558 Robert Israel, <a href="/A103558/b103558.txt">Table of n, a(n) for n = 1..10000</a>
%e A103558 34 is a term because 3^2 + 5^2 = 34 = 2*17; 58 is a term because 3^2 + 7^2 = 58 = 2*29; 74 is a term because 5^2 + 7^2 = 74 = 2*37.
%p A103558 N:= 10000: # to get all terms <= N
%p A103558 P:= select(isprime, [$1..floor(sqrt(N))]):
%p A103558 Res:= NULL:
%p A103558 for i from 1 to nops(P) do
%p A103558   for j from 1 to i-1 do
%p A103558     r:= P[i]^2 + P[j]^2;
%p A103558     if r > N then break fi;
%p A103558     if numtheory:-bigomega(r) = 2 then Res:= Res, r fi;
%p A103558 od od:
%p A103558 sort(convert({Res},list)); # _Robert Israel_, Nov 03 2017
%t A103558 fQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; Select[ Sort[ Flatten[ Table[ Prime[p]^2 + Prime[q]^2, {p, 16}, {q, p - 1}]]], fQ[ # ] &] (* _Robert G. Wilson v_, Mar 23 2005 *)
%o A103558 (PARI) {m=53;v=[];forprime(p=2,m, forprime(q=nextprime(p+1),m,if(bigomega(k=p^2+q^2)==2, v=concat(v,k))));v=vecsort(v);stop=nextprime(m+1)^2;for(j=1,length(v),if(v[j]<stop,print1(v[j],",")))} \\ _Klaus Brockhaus_
%Y A103558 Cf. A001358, A006881, A103739.
%K A103558 easy,nonn
%O A103558 1,1
%A A103558 _Giovanni Teofilatto_, Mar 23 2005
%E A103558 More terms from _Klaus Brockhaus_ and _Robert G. Wilson v_, Mar 23 2005