%I #18 Feb 01 2023 18:38:05
%S 1,3,4,5,7,12,13,19,31,32,36,37,42,47,53,54,55,58,60,63,78,79,82,83,
%T 91,94,102,105,106,118,125,126,133,135,144,155,156,159,161,163,178,
%U 184,190,206,210,214,216,219,247,248,284,286,288,307,313,315,322,336,340,344
%N Either (n-th prime-1)^2-+1, but not both, is prime.
%C Numbers n such that either A005722(n)-+1 is prime.
%H Harvey P. Dale, <a href="/A173444/b173444.txt">Table of n, a(n) for n = 1..1000</a>
%e 1 is in the sequence because (1st prime-1)^2-1=0 is nonprime and (1st prime-1)^2+1=2 is prime;
%e 3 is in the sequence because (3rd prime-1)^2-1=15 is nonprime and (3rd prime-1)^2+1=17 is prime.
%p A005722 := proc(n) (ithprime(n)-1)^2 ; end proc: for n from 1 to 800 do a := A005722(n) ; if isprime(a-1) <> isprime(a+1) then printf("%d,",n) ; end if; end do: # _R. J. Mathar_, Apr 24 2010
%t ppQ[n_]:=Module[{c=(Prime[n]-1)^2},Sort[PrimeQ[{c+1,c-1}]]== {False, True}]; Select[Range[400],ppQ] (* _Harvey P. Dale_, Jun 24 2011 *)
%t Select[Range[400],Total[Boole[PrimeQ[(Prime[#]-1)^2+{1,-1}]]]==1&] (* _Harvey P. Dale_, Feb 01 2023 *)
%Y Cf. A000040, A005722, A006093, A127435.
%K nonn
%O 1,2
%A _Juri-Stepan Gerasimov_, Feb 18 2010, Mar 27 2010
%E More terms from _R. J. Mathar_, Apr 24 2010
%E Definition clarified by _Harvey P. Dale_, Jun 24 2011
|