login
A330536
The partial sum a(1)+...+a(n) is prime, and so is the sum of the digits used by those n terms.
1
2, 1, 4, 6, 24, 22, 8, 42, 28, 60, 26, 46, 44, 40, 68, 66, 112, 158, 64, 86, 84, 118, 62, 88, 20, 48, 156, 114, 136, 138, 132, 150, 116, 82, 192, 176, 190, 392, 198, 172, 152, 178, 240, 206, 174, 282, 244, 80, 154, 242, 204, 202, 228, 170, 246, 130, 648, 110, 756, 196, 194, 222, 208, 266, 286, 284, 280, 200
OFFSET
1,1
COMMENTS
This is the lexicographically earliest sequence of distinct numbers > 0 with this property.
EXAMPLE
The successive partial sums of terms are prime:
(2), (2 + 1) = 3, (2 + 1 + 4) = 7; (2 + 1 + 4 + 6) = 13; (2 + 1 + 4 + 6 + 24) = 37; etc.
The successive partial sums of their digits are also prime:
(2), (2 + 1) = 3, (2 + 1 + 4) = 7; (2 + 1 + 4 + 6) = 13; (2 + 1 + 4 + 6 + 2 + 4) = 19; etc.
MATHEMATICA
Nest[Append[#, Block[{k = 1}, While[Nand[FreeQ[#, k], PrimeQ[Total@ # + k], PrimeQ@ Total@ Flatten@ IntegerDigits[Append[#, k]]], k++]; k]] &, {}, 68] (* Michael De Vlieger, Dec 17 2019 *)
PROG
(C++) See Links section.
CROSSREFS
Cf. A054408 (smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime).
Sequence in context: A269415 A367716 A019142 * A268573 A145858 A328491
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 17 2019
STATUS
approved