A187401 Numbers k such that k^2 + 1 = p*q, p and q primes and |p-q| is square.
30, 100, 144, 274, 484, 516, 526, 756, 1046, 1250, 1714, 1806, 1834, 2284, 2440, 2610, 2940, 3524, 3824, 4190, 5084, 5746, 6766, 7486, 9746, 9920, 10310, 13024, 13210, 15396, 16916, 17546, 18726, 19256, 20000, 21194, 23214, 24964, 30370, 30394, 31126, 31496, 35180, 36680, 37816
Offset: 1
Keywords
Examples
20000 is in the sequence because 20000^2+1 = 19801 * 20201 and 20201 - 19801 = 20^2.
Links
- Robert Israel, Table of n, a(n) for n = 1..600
Programs
-
Maple
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: # Alternative: N:= 500: # to get a(1) to a(N) count:= 0: for k from 2 by 2 while count < N do f:= ifactors(k^2+1)[2]; if nops(f) = 2 and {f[1,2],f[2,2]}={1} and issqr(abs(f[1,1]-f[2,1])) then count:= count+1; A[count]:= k; fi od: seq(A[i],i=1..count); # Robert Israel, Jun 09 2014
-
Mathematica
okQ[k_] := Module[{ff = FactorInteger[k^2+1]}, Length[ff] == 2 && ff[[All, 2]] == {1, 1} && IntegerQ[Sqrt[ff[[2, 1]] - ff[[1, 1]]]]]; Select[Range[2, 40000, 2], okQ] (* Jean-François Alcover, Jun 25 2019 *)
-
Sage
A = [] for k in range(2, 2000, 2): K = k^2 + 1 f = prime_divisors(K) if len(f) == 2: if mul(f) == K: if is_square(abs(f[0]-f[1])): A.append(k) print(A) # Peter Luschny, Jun 10 2014
Comments