login
Maximal differences of A029707.
1

%I #38 May 19 2024 02:15:19

%S 1,2,3,4,6,12,20,24,27,29,42,54,72,75,103,128,131,151,153,162,164,181,

%T 204,208,209,211,237,265,285,286,326,335,340,356,368,392,409,432,439,

%U 441,444,446

%N Maximal differences of A029707.

%F a(n) = primepi(next(A054691(n-1))) - primepi(A054691(n-1)) + 1 for n >= 2, where primepi = A000720 and next(k) is the least lesser of twin primes that is larger than k. - _Amiram Eldar_, May 19 2024

%t nextLesserTwinPrime[p_Integer] := Block[{q = p + 2}, While[ NextPrime@ q - q > 2, q = NextPrime@ q]; q]; p = 2; q = 3; px = 1; qx = 2; mxd = 0; tpx = 0; lst = {}; While[p <

%t 5090000001, d = qx - px; If[ d > mxd, mxd = d; AppendTo[ lst, d]; Print@ d]; p = q; px = qx; q = nextLesserTwinPrime@ q; qx = PrimePi@ q; tpx++]; lst (* _Robert G. Wilson v_, May 21 2014 *)

%o (Sage)

%o def A242459_list(n) :

%o a = [ 1 ]

%o st = 3

%o for i in (4..n) :

%o if (nth_prime(i+1)-nth_prime(i) == 2) :

%o if i-st > a[len(a)-1] :

%o a.append(i-st)

%o st = i

%o return(a)

%o A242459_list(10^(5))

%Y Cf. A000720, A001359, A027833, A029707, A054691.

%K nonn,more

%O 1,2

%A _Jani Melik_, May 15 2014

%E a(20)-a(28) from _Robert G. Wilson v_, May 21 2014

%E a(29)-a(42) from _Amiram Eldar_, May 19 2024