login

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”).

Numbers n such that n^2 is expressible in just one way as (p+1)(q+1) where p, q are distinct primes.
4

%I #17 Jun 16 2017 05:25:51

%S 6,16,28,30,32,44,52,54,64,68,70,76,80,104,164,172,174,182,184,186,

%T 196,222,236,238,246,256,260,266,286,292,306,308,310,316,328,344,350,

%U 352,366,374,418,434,436,442,452,474,494,498,508,512,536,548,570,574,582,584,602,628,632,636,642,644,650,654,664,678

%N Numbers n such that n^2 is expressible in just one way as (p+1)(q+1) where p, q are distinct primes.

%H Robert Israel, <a href="/A274848/b274848.txt">Table of n, a(n) for n = 1..10000</a>

%H Zak Seidov, <a href="/A274848/a274848.txt">Table of n, a(n), p, q; n=1..10000</a>

%e 6^2=36=(2+1)*(11+1), 16^2=256=(7+1)(31+1), 28^2=784=(7+1)(97+1).

%p filter:= proc(n) local F, f, count;

%p F:= select(`<`,numtheory:-divisors(n^2),n);

%p count:= 0;

%p for f in F do

%p if isprime(f-1) and isprime(n^2/f-1) then

%p count:=count+1;

%p if count = 2 then return false fi;

%p fi

%p od;

%p count=1

%p end proc:

%p select(filter, [$1..1000]); # _Robert Israel_, Jul 08 2016

%t fQ[n_] := Block[{c = 0, p = 2}, While[p < n - 1, If[ PrimeQ[n^2/(p +1) -1], c++]; p = NextPrime@ p]; c == 1]; Select[ Range@1000, fQ] (* _Robert G. Wilson v_, Jul 09 2016 *)

%K nonn

%O 1,1

%A _Zak Seidov_, Jul 08 2016