OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = a(n-1)+2^(p(n+1)-p(n)-1).
EXAMPLE
2^(3-2)/2=1, so a(1)=1. 2^(5-3)/2=2, so a(2)=1+2=3.
MATHEMATICA
Accumulate[2^(#-1)&/@Differences[Prime[Range[50]]]] (* Harvey P. Dale, Aug 10 2024 *)
PROG
(MATLAB) P = primes(500); l = length(P); S = P(2:l) - P(1:(l - 1)); A = cumsum(2.^(S-1))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David G. Williams (davwill24(AT)aol.com), Aug 02 2003
EXTENSIONS
Edited by David Wasserman, Aug 28 2003
STATUS
approved