login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

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 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A346134 The sum S of the maximum number of consecutive primes starting with 2 such that S <= prime(n)^2. 0
2, 5, 17, 41, 100, 160, 281, 328, 501, 791, 874, 1264, 1593, 1720, 2127, 2747, 3447, 3638, 4438, 4888, 5117, 6081, 6870, 7699, 9206, 10191, 10538, 11240, 11599, 12718, 15968, 16840, 18650, 19113, 22039, 22548, 24133, 26369, 27517, 29897, 31734, 32353, 36227, 36888 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..44.

EXAMPLE

a(3) = 2+3+5+7 = 17 because 17 <= prime(3)^2 < 28 = 2+3+5+7+11.

a(4) = 2+3+5+7+11+13 = 41 because 41 <= prime(4)^2 < 58 = 2+3+5+7+11+13+17.

MATHEMATICA

Table[k=1; While[(s=Sum[Prime@i, {i, ++k}])<Prime@n^2]; s-Prime@k, {n, 50}] (* Giorgos Kalogeropoulos, Jul 06 2021 *)

PROG

(PARI) a(n) = my(s=0, p=2); while (s+p <= prime(n)^2, s += p; p = nextprime(p+1)); s; \\ Michel Marcus, Jul 05 2021

(Python)

from sympy import prime, nextprime

def a(n):

    p, s, lim = 1, 0, prime(n)**2

    while s <= lim: p = nextprime(p); s += p

    return s - p

print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Jul 05 2021

CROSSREFS

Cf. A001248, A007504.

Sequence in context: A118500 A323427 A080898 * A081763 A013918 A007351

Adjacent sequences:  A346131 A346132 A346133 * A346135 A346136 A346137

KEYWORD

nonn

AUTHOR

Gil Broussard, Jul 05 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 2 16:17 EST 2021. Contains 349445 sequences. (Running on oeis4.)