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 A342156 #28 Dec 23 2024 03:00:18 %S A342156 1,2,1,2,1,2,3,1,0,2,1,2,3,3,1,0,2,1,0,2,3,1,2,1,2,1,2,1,2,3,1,2,1,0, %T A342156 0,2,3,3,1,2,1,2,1,0,0,2,1,2,3,1,2,3,3,3,1,0,2,1,2,1,2,1,2,1,0,2,1,2, %U A342156 3,1,0,0,2,3,1,2,1,2,1,2,1,0,2,3,1,2,1,2,3,1,2,1,2,3,3,1,0,0,2,3,3,1,0,2,3,3 %N A342156 For n > 2, a(n) = 0,1,2, or 3 when (prime(n+1) mod 6, prime(n) mod 6) = (1,1),(1,5),(5,1), or (5,5), respectively. %C A342156 Let p=prime(n), q=prime(n+1). There are only 4 possible combinations for pairs of consecutive primes modulo 6: %C A342156 . %C A342156 a(n)| q | p | q-p | (q-p) mod 6 | (q-p) mod 3 %C A342156 ----+------+------+-----------+-------------+------------ %C A342156 0 | 6m+1 | 6k+1 | 6*(m-k) | 0 | 0 %C A342156 1 | 6m+1 | 6k+5 | 6*(m-k)-4 | -4 or 2 | -1 or 2 %C A342156 2 | 6m+5 | 6k+1 | 6*(m-k)+4 | 4 | 1 %C A342156 3 | 6m+5 | 6k+5 | 6*(m-k) | 0 | 0 %C A342156 . %C A342156 for some positive integers n,m,k. %C A342156 For triples of consecutive primes p,q,s, there are only 8 possible combinations: %C A342156 . %C A342156 {a(n),a(n+1)} | s=prime(n+2) | q=prime(n+1) | p=prime(n) %C A342156 --------------+--------------+--------------+----------- %C A342156 {0,0} | 6r+1 | 6m+1 | 6k+1 %C A342156 {2,1} | 6r+1 | 6m+5 | 6k+1 %C A342156 {1,0} | 6r+1 | 6m+1 | 6k+5 %C A342156 {3,1} | 6r+1 | 6m+5 | 6k+5 %C A342156 {0,2} | 6r+5 | 6m+1 | 6k+1 %C A342156 {2,3} | 6r+5 | 6m+5 | 6k+1 %C A342156 {1,2} | 6r+5 | 6m+1 | 6k+5 %C A342156 {3,3} | 6r+5 | 6m+5 | 6k+5 %C A342156 . %C A342156 Then are only 8 possible pairs of consecutive terms {a(n), a(n+1)}: {0,0}, {0,2}, {1,0}, {1,2}, {2,1}, {2,3}, {3,1}, {3,3}; 8 pairs of consecutive terms are impossible: {0,1}, {0,3}, {1,1}, {1,3}, {2,0}, {2,2}, {3,0}, {3,2}, which follows the fact that the central prime in each triple can't be congruent to 1 (mod 6) AND congruent to 5 (mod 6) (it is congruent either to 1 or 5 (mod 6)). %C A342156 We can create a dichotomic graph structure for triples, quadruples, ... and so on to infinity; every time we have that same number 2^k possible and 2^k impossible cases. %C A342156 set possible pairs {0,0},{0,2},{1,0},{1,2},{2,1},{2,3},{3,1},{3,3} reduced modulo 3 to {0,0},{0,-1},{1,0},{1,-1},{-1,1},{-1,0},{0,1},{0,0} and different are {0,0},{0,1},{0,-1},{1,0},{1,-1},{-1,1},{-1,0} %C A342156 set impossible pairs {0,1},{0,3},{1,1},{1,3},{2,0},{2,2},{3,0},{3,2} reduced modulo 3 to {0,1},{0,0},{1,1},{1,0},{-1,0},{-1,-1},{0,0},{0,1} and different are {0,1},{0,0},{1,1},{1,0},{-1,0},{-1,-1} %C A342156 Theorem B in A341952 is proved on the basis of the above. %C A342156 Because Theorem A in A341765 is equivalent, Theorem B in A341952 also is proved that same way. %F A342156 A341765(n+1) = a(n) mod 3 and later we change 2 -> -1. %e A342156 a(1)=1 because (note that offset is 3 and primes 2,3 are excluded) prime(3+1) = 7 == 1 (mod 6) and prime(3) = 5 == 5 (mod 6), which is the case in which a(n)=1. %t A342156 pp = {}; Do[If[Mod[Prime[n + 1], 6] == 1 && Mod[Prime[n], 6] == 1, AppendTo[pp, 0], If[Mod[Prime[n + 1], 6] == 5 && Mod[Prime[n], 6] == 1, AppendTo[pp, 2], If[Mod[Prime[n + 1], 6] == 1 && Mod[Prime[n], 6] == 5, AppendTo[pp, 1], If[Mod[Prime[n + 1], 6] == 5 && Mod[Prime[n], 6] == 5, AppendTo[pp, 3]]]]], {n, 3, 108}]; pp %Y A342156 Cf. A341765, A341952. %K A342156 nonn %O A342156 3,2 %A A342156 _Artur Jasinski_, Mar 02 2021