OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 25 because it is an odd nonprime preceded by the prime 23 and followed by the odd nonprime 27.
MATHEMATICA
Select[Range[5, 1000, 2], !PrimeQ[#] && PrimeQ[#-2] && !PrimeQ[#+2]&] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *)
2#-1&/@(Mean/@SequencePosition[Table[If[PrimeQ[n], 1, 0], {n, 1, 601, 2}], {1, 0, 0}]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 31 2020 *)
Select[Partition[Range[600], 5, 2], PrimeQ[#[[1]]]&&AllTrue[{#[[3]], #[[5]]}, CompositeQ]&][[;; , 3]] (* Harvey P. Dale, May 14 2023 *)
PROG
(UBASIC) 10 'primes using counters 20 N=3:print "2 "; :print "3 "; :C=2 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 55 55 Q=N+2:R=N-2: if Q<>prmdiv(Q) and N<>prmdiv(N) and R=prmdiv(R) then print Q; N; R; "-"; :stop:else N=N+2:goto 30 60 A=A+2 70 if A<=sqrt(N) then 40:stop 81 C=C+1 100 N=N+2:goto 30
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Oct 08 2007
EXTENSIONS
Definition corrected by Jens Voß, Mar 12 2014
Definition modified by Harvey P. Dale, May 14 2023
STATUS
approved