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.

A383938 a(n) is the least positive integer k such that b(2*j) is prime for 1 <= j <= n but not prime for j = n+1, where b(1) = k and b(m+1) = b(m) + prime(m) for m >= 1.

Original entry on oeis.org

2, 5, 21, 129, 69, 1, 51, 23991, 171, 1371, 3, 322141431, 1431357020859
Offset: 0

Views

Author

Om S. M. Yadav, Aug 18 2025

Keywords

Comments

Similar to A227547, primes are added in successive manner except that here the sequence breaks if an even-indexed term is not prime and considers preceding even-indexed prime as the last term of the sequence. For example, a(2) = 21 [21, 23, 26, 31, 38, 49] but since 49 is not prime, last two terms (38 and 49) are omitted leaving 31 as last term in the sequence.
a(12) is the last term, because b(j) is always divisible by 11 for some j in {2, 4, 6, 8, 10, 14, 16, 18, 22, 24, 26}. - Pontus von Brömssen, Aug 19 2025

Examples

			a(n) = k, b(m+1) = b(m) + prime(m); b(1) = k
For n = 0, a(0) = 2; b(m+1) = b(m) + prime(m): [2]
For n = 1, a(1) = 5; b(m+1) = b(m) + prime(m): [5, 7(5+2)]
For n = 2, a(2) = 21; b(m+1) = b(m) + prime(m): [21, 23(21+2), 26(23+3), 31(26+5)]
For n = 3, a(3) = 129; b(m+1) = b(m) + prime(m): [129, 131(129+2), 134(131+3), 139(134+5), 146(139+7), 157(146+11)]
For n = 4, a(4) = 69; b(m+1) = b(m) + prime(m): [69, 71(69+2), 74(71+3), 79(74+5), 86(79+7), 97(86+11), 110(97+13), 127(110+17)]
For n = 5, a(5) = 1; b(m+1) = b(m) + prime(m): [1, 3(1+2), 6(3+3), 11(6+5), 18(11+7), 29(18+11), 42(29+13), 59(42+17), 78(59+19), 101(78+23)]
For a(n), even-indexed term is prime. e.g. for a(3) = 129 [129, 131, 134, 139, 146, 157], even indexed terms 131, 139, 157 are primes.
		

Crossrefs

Programs

  • PARI
    a(n) = my(vp=concat(2, vector(n+1, i, sum(k=1, 2*i+1, prime(k)))), v=concat(vector(n, i, 1), 0), k=1); while (apply(ispseudoprime, vector(n+1, i, vp[i]+k)) != v, k++); k; \\ Michel Marcus, Aug 19 2025

Extensions

a(11) from Michel Marcus, Aug 19 2025
a(12) from Pontus von Brömssen, Aug 19 2025