OFFSET
1,1
COMMENTS
Composite numbers that are nearer to the immediately previous prime than to the immediately next prime.
Members of this sequence are the numbers C, necessarily composite, such that P_n < C < I_n, where P_n is the n-th odd prime and I_n the interprime (A024675) between P_n and P_n+1.
Prime-free subsequence of A264720.
LINKS
Chris Boyd, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 33 because 33 < (31 + 37)/2 = 34.
MATHEMATICA
Select[Range@ 204, And[CompositeQ@ #, # < (NextPrime[#, -1] + NextPrime@ #)/2] &] (* Michael De Vlieger, Nov 22 2015 *)
Range[#[[1]]+1, Total[#]/2 -1]&/@Select[Partition[Prime[Range[50]], 2, 1], #[[2]]- #[[1]]>2&]//Flatten (* Harvey P. Dale, Jul 28 2020 *)
PROG
(PARI) test(n)= {if(n-precprime(n-1)<nextprime(n+1)-n&&n>2&&!isprime(n), return(1), return(0))}
for(i=1, 200, if(test(i), print1(i, ", ")))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Chris Boyd, Nov 21 2015
STATUS
approved