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

Primes prime(n) such that prime(n+1) - prime(n) > prime(n+2) - prime(n+1).
6

%I #28 Mar 29 2022 19:29:14

%S 7,13,23,31,37,53,61,67,73,89,97,103,113,131,139,157,173,181,193,211,

%T 223,233,241,263,271,277,293,307,317,337,359,373,389,409,421,433,449,

%U 457,467,479,491,509,523

%N Primes prime(n) such that prime(n+1) - prime(n) > prime(n+2) - prime(n+1).

%C This was originally formulated as (-prime(n) + 2*prime(n+1) - prime(n+2))/((1 - prime(n) + prime(n+1))^(3/2)) > 0, which relates it to other sequences. This is equivalent since the denominator is always positive.

%H Reinhard Zumkeller, <a href="/A147812/b147812.txt">Table of n, a(n) for n = 1..10000</a>

%e The gap between 7 and the next prime, 11, is 4, which is greater than the next prime gap from 11 to 13, so 7 is in the sequence.

%t d2[n_] = Prime[n + 2] - 2*Prime[n + 1] + Prime[n]; d1[n_] = Prime[n + 1] - Prime[n]; k[n_] = -d2[n]/(1 + d1[n])^(3/2); Flatten[Table[If[k[n] > 0, Prime[n], {}], {n, 1, 100}]]

%t Select[Partition[Prime[Range[150]],3,1],#[[2]]-#[[1]]>#[[3]]-#[[2]]&][[All,1]] (* _Harvey P. Dale_, Mar 29 2022 *)

%o (Haskell)

%o import Data.List (findIndices)

%o a147812 n = a147812_list !! (n-1)

%o a147812_list = map (a000040 . (+ 1)) $ findIndices (< 0) a036263_list

%o -- _Reinhard Zumkeller_, Jan 20 2012

%o (Ruby)

%o require 'mathn'

%o Prime.take(100).each_cons(3).select{ |a,b,c| b-a>c-b }.map(&:first)

%o -- _Aaron Weiner_, Dec 05 2013

%Y Cf. A036263, A147813 (complement with respect to A000040).

%K nonn

%O 1,1

%A _Roger L. Bagula_, Nov 13 2008

%E Edited by _Alonso del Arte_ and _Joerg Arndt_, Nov 01 2013

%E Simpler formula added by _Aaron Weiner_, Dec 05 2013