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”).

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
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, 71, 57, 73, 77, 91, 75, 59, 95, 93, 79, 110, 12, 21, 28, 14, 25, 42, 18, 23, 26, 32, 27, 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
OFFSET
1,2
LINKS
EXAMPLE
After 8 and 6 the next term is 3 as 8+6+3 = 17 is a prime;
After 6 and 3 the next term is 20 as 6+3+2 = 11 and 3+2+0 = 5 are primes;
After 20 the next term is 9 as 2+0+9 = 11 is a prime; etc.
MATHEMATICA
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 *)
CROSSREFS
Cf. A076990 (3 successive terms have a prime sum), A330424 (3 successive terms AND 3 successive digits have a prime sum).
Sequence in context: A262942 A352808 A076990 * A330424 A057168 A087711
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 14 2019
STATUS
approved