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.

A330536 The partial sum a(1)+...+a(n) is prime, and so is the sum of the digits used by those n terms.

Original entry on oeis.org

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

Views

Author

Eric Angelini and Carole Dubois, Dec 17 2019

Keywords

Comments

This is the lexicographically earliest sequence of distinct numbers > 0 with this property.

Examples

			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.
		

Crossrefs

Cf. A054408 (smallest positive integer not already in sequence such that the partial sum a(1)+...+a(n) is prime).

Programs

  • 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 *)