Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Nov 16 2021 07:34:57
%S 11,16,27,38,44,45,52,55,56,57,63,64,68,74,75,76,77,81,112,113,114,
%T 124,134,141,142,143,148,151,152,170,180,181,182,183,184,191,192,209,
%U 214,215,216,227,240,251,252,255,256,263,266,269,270,274,275,293,294,295
%N Numbers m such that m^2 + (m+/-1)^2 are both semiprimes.
%e 38 is a term because 38^2 + 37^2 = 2813 = 29*97 (semiprime) and 38^2 + 39^2 = 2965 = 5*593 (semiprime).
%t Select[Range[2, 400], Plus@@Last/@FactorInteger[ #^2+(#+1)^2]==Plus@@Last/@FactorInteger[ #^2+(#-1)^2]==2&]
%o (Python)
%o from sympy import factorint
%o def issemiprime(n): return sum(factorint(n).values()) == 2
%o def ok(n): return all(issemiprime(n**2 + (n+k)**2) for k in [1, -1])
%o print([k for k in range(296) if ok(k)]) # _Michael S. Branicky_, Nov 16 2021
%K nonn
%O 1,1
%A _Zak Seidov_, Jun 25 2005
%E Title corrected by _Michael S. Branicky_, Nov 16 2021