login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A110299
a(n) = Sum_{i=0..n-1} 2^i*prime(n-i).
5
2, 7, 19, 45, 101, 215, 447, 913, 1849, 3727, 7485, 15007, 30055, 60153, 120353, 240759, 481577, 963215, 1926497, 3853065, 7706203, 15412485, 30825053, 61650195, 123300487, 246601075, 493202253, 986404613, 1972809335, 3945618783, 7891237693, 15782475517
OFFSET
1,1
REFERENCES
Eric Angelini, "Array with primes." Pers. comm. on the SeqFan mailing list, Sep. 7 2005.
LINKS
FORMULA
G.f: b(x)/(1-2*x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = 2*a(n-1) + A000040(n) for n>0 with a(0)=0. - Alois P. Heinz, Dec 10 2016
From Ridouane Oudra, Jan 25 2024: (Start)
a(n) = Sum_{i=0..prime(n+1)-1} (2^(n-pi(i)) - 1), where prime(n) = A000040(n) and pi(n) = A000720(n).
a(n) = A125180(n+1) - A000040(n+1);
a(n) = Sum_{i=1..n} A125180(i);
a(n) = A007504(n) + Sum_{i=1..n-1} a(i). (End)
MAPLE
a:= proc(n) option remember;
`if`(n=0, 0, ithprime(n)+2*a(n-1))
end:
seq(a(n), n=1..30); # Alois P. Heinz, Dec 10 2016
MATHEMATICA
Table[Sum[2^i * Prime[n-i], {i, 0, n-1}], {n, 1, 30}]
PROG
(PARI) a(n) = fromdigits(primes(n), 2); \\ Kevin Ryde, Jun 22 2022
(Magma)
A110299:= func< n | (&+[2^(n-j)*NthPrime(j): j in [1..n]]) >;
[A110299(n): n in [1..40]]; // G. C. Greubel, Jan 03 2023
(SageMath)
@CachedFunction # a = A110299
def a(n): return 2 if (n==1) else 2*a(n-1) + nth_prime(n)
[a(n) for n in range(1, 41)] # G. C. Greubel, Jan 03 2023
(Python)
from sympy import prime
def A110299(n):
c = 0
for i in range(n):
c = (c<<1)+prime(i+1)
return c # Chai Wah Wu, Jan 04 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ryan Propper, Sep 07 2005
STATUS
approved