login
A086769
a(n) = sum{2^(b(i)-1): 1<=i<=n}, where b(n) is the differences between consecutive primes.
1
1, 3, 5, 13, 15, 23, 25, 33, 65, 67, 99, 107, 109, 117, 149, 181, 183, 215, 223, 225, 257, 265, 297, 425, 433, 435, 443, 445, 453, 8645, 8653, 8685, 8687, 9199, 9201, 9233, 9265, 9273, 9305, 9337, 9339, 9851, 9853, 9861, 9863, 11911, 13959, 13967, 13969
OFFSET
1,2
LINKS
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
Cf. A001223.
Sequence in context: A348659 A137162 A293863 * A018753 A073217 A063484
KEYWORD
nonn,easy
AUTHOR
David G. Williams (davwill24(AT)aol.com), Aug 02 2003
EXTENSIONS
Edited by David Wasserman, Aug 28 2003
STATUS
approved