Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A350172
Start from 1st prime 2, and write it twice, then add 3 to get 5 and write it 3 times, then add 5 to get 10 and write it 5 times, and so on.
0
2, 2, 5, 5, 5, 10, 10, 10, 10, 10, 17, 17, 17, 17, 17, 17, 17, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 77, 77, 77, 77, 77, 77, 77, 77
OFFSET
1,1
REFERENCES
J.-P. Delahaye, Des suites fractales d’entiers, Pour la Science, No. 531 January 2022. Sequence e) p. 82.
MATHEMATICA
nxt[{p_, t_}]:=Module[{n=NextPrime[p]}, {n, PadRight[{}, n, t+n]}]; Join[{2}, NestList[nxt, {2, 2}, 10][[;; , 2]]]//Flatten (* Harvey P. Dale, Jun 05 2023 *)
PROG
(Python)
from sympy import nextprime
from itertools import islice, repeat
def primes(p=2):
while True: yield p; p = nextprime(p)
def agen():
primesum = 0
for p in primes():
primesum += p
yield from repeat(primesum, p)
print(list(islice(agen(), 66))) # Michael S. Branicky, Dec 18 2021
CROSSREFS
Cf. A007504.
Sequence in context: A063960 A295514 A025510 * A356387 A172417 A158106
KEYWORD
nonn
AUTHOR
Michel Marcus, Dec 18 2021
EXTENSIONS
a(19) and beyond from Michael S. Branicky, Dec 18 2021
STATUS
approved