This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A330026 #69 Feb 16 2025 08:33:59 %S A330026 1,1,2,2,5,4,5,4,5,6,10,9,8,5,8,7,15,12,14,17,12,15,11,16,16,18,13,14, %T A330026 14,21,45,29,34,26,32,25,25,25,22,20,26,20,32,24,33,23,38,48,36,34,40, %U A330026 30,31,30,37,31,33,39,37,38,32,48,41,44,36,52,54,43,43,51 %N A330026 a(n) is the number of integers k > prime(n) such that all rows (after the initial row) of the triangle of absolute differences of the (n+1)-tuple (prime(1), ..., prime(n), k) all start with 1. %C A330026 Suggested by Gilbreath's conjecture (see A036262). %C A330026 The sequence of primes considered in Gilbreath's conjecture is just one possibility out of all the sequences that can be generated starting from (2,3,...,prime(n)). %C A330026 Conjecture: Prime(n+1) is always between prime(n)+2 and prime(n)+2*a(n). %H A330026 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GilbreathsConjecture.html">Gilbreath's Conjecture</a> %F A330026 Given the sequence of primes S = (2,3,5,...,prime(n)) and the triangle of the forward absolute differences of S, let d(r) be the last rightmost absolute difference of row r, for r>1. Then a(n) = (1+ Sum_{r>1} d(r)) / 2. %e A330026 a(1) = 1, because considering the sequence (2,k), k=3 is the only solution. %e A330026 a(2) = 1, because considering the sequence (2,3,k), k=5 is the only solution. %e A330026 To calculate a(3), consider the sequence (2,3,5) and calculate the triangle of absolute differences: %e A330026 2,3,5 %e A330026 1,2 %e A330026 1 %e A330026 Consider the rightmost diagonal, which contains the absolute differences (2,1), then a(3) is given by a(3) = [(2+1) + 1]/2 = 2. %e A330026 That is, a(3) is the result of summing the two differences contained in the rightmost diagonal (2,1). To this sum we add 1 and divide the total by 2. %e A330026 So there are 2 integers k > prime(3) = 5 -- namely, 7,9 -- such that the forward absolute differences of (2,3,5,k) start with 1. %e A330026 To be explicit, there are two triangles of absolute differences resulting from (2,3,5,k), namely %e A330026 2 3 5 7 %e A330026 1 2 2 %e A330026 1 0 %e A330026 1 %e A330026 and %e A330026 2 3 5 9 %e A330026 1 2 4 %e A330026 1 2 %e A330026 1 %e A330026 a(24) = 16 because there are 16 integers k > prime(25) = 97 -- namely, 99,101,...,129 -- such that all rows (after the first row) of the triangle of absolute differences of (2,3,5,7,11,13,17,...,97,k) start with 1. %o A330026 (Python) %o A330026 # run the function find_M(n), where n is the last prime number of your list of consecutive primes starting from 2 %o A330026 from sympy import isprime %o A330026 def primes_less_N(n): %o A330026 primes = [] %o A330026 for i in range(2,n+1): %o A330026 if(isprime(i)==True): %o A330026 primes.append(i) %o A330026 return primes %o A330026 def find_M(n): %o A330026 primes = primes_less_N(n) %o A330026 l = len(primes) %o A330026 count = 1 %o A330026 if count == 1: %o A330026 a = [abs(x - primes[i - 1]) for i, x in enumerate(primes)][1:] %o A330026 count += 1 %o A330026 list_f = [] %o A330026 if count > 1: %o A330026 while count <l+1: %o A330026 list_f.append(a[len(a)-1]) %o A330026 b = [abs(x - a[i-1]) for i, x in enumerate(a)][1:] %o A330026 a=b %o A330026 count +=1 %o A330026 return (sum(list_f)+1)/2 %o A330026 (PARI) diffs(v) = {while (#v != 1, v = vector(#v-1, k, abs(v[k+1] - v[k]));); v[1];} %o A330026 a(n) = {my(v = primes(n), m = vecmax(v)+1, nb = 0); if (!(m%2), m++); forstep (k=m, oo, 2, if (diffs(concat(v, k)) == 1, nb++, if (nb, break));); nb;} \\ _Michel Marcus_, Dec 03 2019 %Y A330026 Cf. A036262, A036261. %K A330026 nonn %O A330026 1,3 %A A330026 _Fabio Mercurio_, Nov 27 2019