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.
%I A187401 #25 Mar 07 2020 12:24:48 %S A187401 30,100,144,274,484,516,526,756,1046,1250,1714,1806,1834,2284,2440, %T A187401 2610,2940,3524,3824,4190,5084,5746,6766,7486,9746,9920,10310,13024, %U A187401 13210,15396,16916,17546,18726,19256,20000,21194,23214,24964,30370,30394,31126,31496,35180,36680,37816 %N A187401 Numbers k such that k^2 + 1 = p*q, p and q primes and |p-q| is square. %C A187401 Note that if k^2+1 = p*q, then p+q cannot be a square. Proof by contradiction. There are two cases: p an odd prime and p=2. Case 1: suppose p and q are odd primes and q = y^2-p. Note that y must be an even number in order for q to be odd. Then p(y^2-p) = x^2+1 for some even x. Rearranging terms, we obtain p*y^2-1 = p^2+x^2. Looking at this equation modulo 4, we obtain -1 = 1, a contradiction. Case 2: Let p=2. Then we obtain 2y^2-x^2 = 5, which has no solutions in integers. - _T. D. Noe_, Mar 10 2011 %H A187401 Robert Israel, <a href="/A187401/b187401.txt">Table of n, a(n) for n = 1..600</a> %e A187401 20000 is in the sequence because 20000^2+1 = 19801 * 20201 and 20201 - 19801 = 20^2. %p A187401 with(numtheory):nn:=50000:for i from 1 to nn do: n:=i^2+1:x:=factorset(n):x1:=nops(x):x2:=bigomega(n):if x1=2 and x2=2 then z:=x[2]-x[1] :w:=sqrt(z):if w= floor(w) then printf(`%d, `, i):else fi:else fi :od: %p A187401 # Alternative: %p A187401 N:= 500: # to get a(1) to a(N) %p A187401 count:= 0: %p A187401 for k from 2 by 2 while count < N do %p A187401 f:= ifactors(k^2+1)[2]; %p A187401 if nops(f) = 2 and {f[1,2],f[2,2]}={1} and issqr(abs(f[1,1]-f[2,1])) then %p A187401 count:= count+1; %p A187401 A[count]:= k; %p A187401 fi %p A187401 od: %p A187401 seq(A[i],i=1..count); # _Robert Israel_, Jun 09 2014 %t A187401 okQ[k_] := Module[{ff = FactorInteger[k^2+1]}, Length[ff] == 2 && ff[[All, 2]] == {1, 1} && IntegerQ[Sqrt[ff[[2, 1]] - ff[[1, 1]]]]]; %t A187401 Select[Range[2, 40000, 2], okQ] (* _Jean-François Alcover_, Jun 25 2019 *) %o A187401 (Sage) %o A187401 A = [] %o A187401 for k in range(2, 2000, 2): %o A187401 K = k^2 + 1 %o A187401 f = prime_divisors(K) %o A187401 if len(f) == 2: %o A187401 if mul(f) == K: %o A187401 if is_square(abs(f[0]-f[1])): %o A187401 A.append(k) %o A187401 print(A) # _Peter Luschny_, Jun 10 2014 %Y A187401 Cf. A134406, A134407, A002522, A005574. %K A187401 nonn %O A187401 1,1 %A A187401 _Michel Lagneau_, Mar 09 2011