OFFSET
1,1
COMMENTS
Row sums of A125179.
Limit_{n->oo} a(n)/a(n-1) = 2.
LINKS
James C. McMahon, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = prime(n) + Sum_{j=1..n-1} 2^(n-j-1)*prime(j), where prime(k) denotes the k-th prime.
a(n) = Sum_{i=0..prime(n)-1} 2^(n-1-pi(i)), where prime(n) = A000040(n) and pi(n) = A000720(n). - Ridouane Oudra, Oct 17 2019
a(1) = 2 and a(n) = prime(n) + Sum_{i=1..n-1} a(i) for n > 1. - Alexandre Herrera, Dec 10 2023
EXAMPLE
a(4)=26 because 4*prime(1)+2*prime(2)+prime(3)+prime(4) = 8+6+5+7 = 26.
MAPLE
a[1]:=2: for n from 2 to 35 do a[n]:=2*a[n-1]+ithprime(n)-ithprime(n-1) od: seq(a[n], n=1..35);
MATHEMATICA
a[1] = 2; a[n_] := 2*a[n - 1] + Prime[n] - Prime[n - 1]; Table[a[n], {n, 1, 31}] (* James C. McMahon, Dec 10 2023 *)
PROG
(Magma) [n eq 1 select 2 else 2*Self(n-1)+NthPrime(n)-NthPrime(n-1):n in [1..31]]; // Marius A. Burtea, Oct 17 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Nov 22 2006
EXTENSIONS
Edited by N. J. A. Sloane, Dec 02 2006
STATUS
approved