cp's OEIS Frontend

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.

A366032 Difference d between the least odd integer that would disprove Gilbreath's conjecture and prime(n).

This page as a plain text file.
%I A366032 #33 Oct 22 2023 15:58:25
%S A366032 2,4,2,10,6,10,6,6,12,16,16,16,8,12,10,30,20,26,34,20,28,18,26,30,36,
%T A366032 24,28,26,30,88,54,68,44,64,46,46,48,40,36,52,32,64,46,66,36,66,94,72,
%U A366032 66,76,60,54,56,70,58,66,74,72,76,56,84,80,88,70,92,104,78,86,100,84,66,86,84,86,96
%N A366032 Difference d between the least odd integer that would disprove Gilbreath's conjecture and prime(n).
%C A366032 In Gilbreath's conjecture the leading row lists the primes. In this sequence we take as leading row the first n-1 primes joined with the least odd integer k that disproves Gilbreath's conjecture instead of prime(n).
%C A366032 The terms of the sequence are the difference of this hypothetical number k and prime(n).
%C A366032 k is always greater than prime(n-1). The first 1000 terms show that k is greater than prime(n).
%C A366032 Although the first 1000 terms are positive, in theory a term can be negative: prime(n-1) < k < prime(n).
%C A366032 If we find a term that is zero then k = prime(n) and that would disprove the conjecture.
%e A366032 The first term of the sequence is a(3) = 2 (offset is 3)
%e A366032 We start with the first 2 primes and instead of the third prime, we choose k=7.
%e A366032   2,3  -->  2,3,7  instead of  2,3,5
%e A366032   1         1,4                1,2
%e A366032             3                  1
%e A366032 .
%e A366032 k=7 is the least odd integer that disproves the conjecture. So, a(3) = k-prime(3) = 7 - 5 = 2.
%e A366032 .
%e A366032   2,3,5,7,11  -->  2,3,5,7,11,23  instead of  2,3,5,7,11,13
%e A366032   1,2,2,4          1,2,2,4,12                 1,2,2,4,2
%e A366032   1,0,2            1,0,2,8                    1,0,2,2
%e A366032   1,2              1,2,6                      1,2,0
%e A366032   1                1,4                        1,2
%e A366032                    3                          1
%e A366032 k=23 is the least odd integer that disproves the conjecture. So, a(6) = k-prime(6) = 23 - 13 = 10.
%t A366032 Table[(k=Prime@n;While[Nest[Abs@*Differences,Join[Prime@Range@n,{k}],n]=={1},k=k+2];k)-NextPrime@Prime@n,{n,2,100}]
%o A366032 (PARI) isok(v) = my(nb=#v); for (i=1, nb-1, v = vector(#v-1, k, abs(v[k+1]-v[k]));); v[1] == 1;
%o A366032 a(n) = my(v = primes(n-1), k=prime(n)); while (isok(concat(v, k)), k+=2); k - prime(n); \\ _Michel Marcus_, Sep 28 2023
%Y A366032 Cf. A036262, A363003.
%K A366032 nonn
%O A366032 3,1
%A A366032 _Giorgos Kalogeropoulos_, Sep 27 2023