The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A330434 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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 12 14:14 EDT 2024. Contains 375851 sequences. (Running on oeis4.)