%I #7 Mar 19 2024 13:43:56
%S 1,3,8,19,42,85,174,353,712,1431,2864,5743,11492,22989,45982,91971,
%T 183968,367939,735888,1471789,2943596,5887195,11774408,23548837,
%U 47097690,94195387,188390808,376781617,753563240,1507126509,3014253028
%N a(0) = 1, a(n+1) = a(n) + next prime larger than a(n).
%e For instance 1+2=3, 3+5=8, 8+11=19, 19+23=42, 42+43=85, ...
%t Needs[ "NumberTheory`NumberTheoryFunctions`" ]; NestList[ # + NextPrime[ # ] &, 1, 50 ]
%o (Python)
%o from itertools import islice
%o from sympy import nextprime
%o def A074839_gen(): # generator of terms
%o yield (a:=1)
%o while (a:=a+nextprime(a)): yield a
%o A074839_list = list(islice(A074839_gen(),20)) # _Chai Wah Wu_, Mar 19 2024
%Y Cf. A063807.
%K easy,nonn
%O 0,2
%A _Robert G. Wilson v_, Sep 09 2002
|