login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1, a(2) = 2; thereafter a(n) = smallest number not occurring earlier such that the sum of three successive digits is prime.
1

%I #15 Jan 06 2020 21:26:52

%S 1,2,4,5,8,6,3,20,9,22,7,24,10,11,13,17,31,15,51,19,35,33,53,37,39,55,

%T 71,57,73,77,91,75,59,95,93,79,110,12,21,28,14,25,42,18,23,26,32,27,

%U 40,16,41,60,50,29,62,30,43,44,34,45,48,54,49,46,38,63,80,52,47,64,36,83,68,56,61,66,58,65,84,70,67,401

%N a(1) = 1, a(2) = 2; thereafter a(n) = smallest number not occurring earlier such that the sum of three successive digits is prime.

%H Carole Dubois, <a href="/A330434/b330434.txt">Table of n, a(n) for n = 1..508</a>

%e After 8 and 6 the next term is 3 as 8+6+3 = 17 is a prime;

%e After 6 and 3 the next term is 20 as 6+3+2 = 11 and 3+2+0 = 5 are primes;

%e After 20 the next term is 9 as 2+0+9 = 11 is a prime; etc.

%t Nest[Append[#, Block[{k = 3}, While[Nand[FreeQ[#, k], AllTrue[Table[Total@ #[[i ;; i + 2]], {i, Length@ # - 2}], PrimeQ] &@ Flatten@ IntegerDigits@ Append[#, k] ], k++]; k]] &, {1, 2}, 80] (* _Michael De Vlieger_, Dec 14 2019 *)

%Y Cf. A076990 (3 successive terms have a prime sum), A330424 (3 successive terms AND 3 successive digits have a prime sum).

%K base,nonn

%O 1,2

%A _Eric Angelini_ and _Carole Dubois_, Dec 14 2019