login
Integers n such that 4*prime(n)-+3 are nonconsecutive primes.
1

%I #20 Dec 21 2015 13:06:51

%S 1,3,5,95,98,175,189,458,487,501,541,638,735,969,1015,1027,1526,2133,

%T 2256,2290,2329,2506,2600,2699,3106,3939,3999,4552,5548,5585,5611,

%U 5803,5838,6355,6756,6856,6982,6983,7070,7107,7167,7383,8421,8868,9157,9249,9405

%N Integers n such that 4*prime(n)-+3 are nonconsecutive primes.

%C Subsequence of A174011: 4*prime(n)-+3 are both prime. - _Michel Marcus_, Apr 07 2014

%H Robert Israel, <a href="/A173487/b173487.txt">Table of n, a(n) for n = 1..3000</a>

%e a(1)=1 because 4*prime(1)-3=5=3rd prime and 4*prime(1)+3=11=5th prime;

%e a(2)=3 because 4*prime(3)-3=17=7th prime and 4*prime(3)+3=23=9th prime;

%e a(3)=5 because 4*prime(5)-3=41=13th prime and 4*prime(5)+3=47=15th prime;

%e a(4)=95 because 4*prime(95)-3=1993=301st prime and 4*prime(95)=3=1999=303rd prime.

%p N:= 1000: # to get a(1) to a(N)

%p p:= 0:

%p A:= NULL:

%p count:= 0:

%p for n from 1 while count < N do

%p p:= nextprime(p);

%p if isprime(4*p-3) and isprime(4*p+3) and (isprime(4*p-1) or isprime(4*p+1))

%p then count:= count+1; A:= A, n

%p fi

%p od:

%p A; # _Robert Israel_, Dec 20 2015

%t Select[Range@ 10000, And[PrimeQ[4 Prime[#] - 3], PrimeQ[4 Prime[#] + 3], NextPrime[4 Prime[#] - 3] != 4 Prime[#] + 3] &] (* _Michael De Vlieger_, Dec 20 2015 *)

%o (PARI) isok(n) = isprime(pa=4*prime(n)-3) && isprime(pb=4*prime(n)+3) && (primepi(pb) - primepi(pa) != 1); \\ _Michel Marcus_, Apr 07 2014

%Y Cf. A000040, A002145, A111055.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Mar 05 2010

%E Corrected (85 replaced by 95, 286 and 321 removed) and extended by _R. J. Mathar_, May 02 2010

%E More terms from _Michel Marcus_, Apr 07 2014