A285010 a(n+1) = a(n) + p, where p is the largest prime less than a(n); a(1) = 3.
3, 5, 8, 15, 28, 51, 98, 195, 388, 771, 1540, 3071, 6138, 12271, 24540, 49073, 98142, 196271, 392518, 785021, 1570038, 3140045, 6280086, 12560153, 25120300, 50240589, 100481176, 200962343, 401924670, 803849309, 1607698612, 3215397195, 6430794388, 12861588761, 25723177510
Offset: 1
Examples
a(1) = 3, the first odd prime. The greatest prime less than 3 is 2, so a(2) = 3 + 2 = 5. Greatest prime less than 5 is 3 so a(3) = 5 + 3 = 8. Likewise a(4) = 8 + 7 = 15; etc.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..3000
Programs
-
Mathematica
a[1]=3; a[n_] := a[n] = a[n-1] + NextPrime[a[n-1], -1]; Array[a, 35] (* Giovanni Resta, Apr 10 2017 *) NestList[#+NextPrime[#,-1]&,3,40] (* Harvey P. Dale, Aug 22 2020 *)
-
PARI
lista(nn) = { print1(a=3, ", "); for (n=2, nn, a += precprime(a-1); print1(a, ", ");); } \\ Michel Marcus, Apr 08 2017
Formula
a(n) ~ c * 2^n, where c = 0.748642996358317338.... - Bill McEachen, May 09 2024
Extensions
More terms from Michel Marcus, Apr 08 2017
Comments