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.

A346786 If a(n) is prime, then a(n) + a(n+1) is prime; if a(n) is not prime, then a(n) + a(n+1) is not prime. This is also true for pairs of consecutive digits: if the first one is prime, the sum of the pair is also prime; if the first one is nonprime, the sum of the pair is nonprime. This is the lexicographically earliest sequence of distinct terms > 0 with this property.

This page as a plain text file.
%I A346786 #13 May 09 2022 15:12:30
%S A346786 2,1,3,4,5,6,8,7,40,9,13,46,20,10,15,21,30,18,17,42,32,19,34,23,44,25,
%T A346786 29,38,48,45,60,62,50,64,52,56,63,80,66,68,70,82,58,74,69,76,84,81,87,
%U A346786 401,86,88,100,90,93,201,91,95,200,96,99,97,406,204,206,208,101,300
%N A346786 If a(n) is prime, then a(n) + a(n+1) is prime; if a(n) is not prime, then a(n) + a(n+1) is not prime. This is also true for pairs of consecutive digits: if the first one is prime, the sum of the pair is also prime; if the first one is nonprime, the sum of the pair is nonprime. This is the lexicographically earliest sequence of distinct terms > 0 with this property.
%e A346786 a(1) = 2 (prime) and a(1) + a(2) = 2 + 1 = 3 [which is prime, like a(1)];
%e A346786 a(2) = 1 (nonprime) and a(2) + a(3) = 1 + 3 = 4 [which is nonprime, like a(2)];
%e A346786 a(3) = 3 (prime) and a(3) + a(4) = 3 + 4 = 7 [which is prime, like a(3)];
%e A346786 a(4) = 4 (nonprime) and a(4) + a(5) = 4 + 5 = 9 [which is nonprime, like a(4)];
%e A346786 a(5) = 5 (prime) and a(5) + a(6) = 5 + 6 = 11 [which is prime, like a(5)];
%e A346786 (...)
%e A346786 a(8) = 7 (prime) and a(8) + a(9) = 7 + 40 = 47 [which is prime, like a(8)];
%e A346786 now we have to consider also the digits of the pair (7,4); they are "7", the last digit of a(8), and "4", the first digit of a(9): as the first digit of the pair is prime (7), the sum of this 7 and the next digit (4) has to be prime too, which is the case, 4 + 7 = 11;
%e A346786 a(9) = 40 (nonprime) and a(9) + a(10) = 40 + 9 = 49 [which is nonprime, like a(9)];
%e A346786 the next pair of digits we have to consider after (7,4) is (4,0); as 4 is nonprime, so has to be the sum 4 + 0 (which is the case as 4 + 0 = 4); etc.
%t A346786 t[x_,y_]:=If[PrimeQ@x,PrimeQ[x+y],!PrimeQ[x+y]];a[1]=2;a[n_]:=a[n]=Block[{k=1},While[MemberQ[Array[a,n-1],k]||!And@@(t@@@Partition[Flatten[IntegerDigits/@Join[Array[a,n-1],{k}]],2,1])||!t@@{a[n-1],k},k++];k];Array[a,68] (* _Giorgos Kalogeropoulos_, May 09 2022 *)
%Y A346786 Cf. A219110.
%K A346786 base,nonn
%O A346786 1,1
%A A346786 _Eric Angelini_ and _Carole Dubois_, Aug 03 2021