OFFSET
1,2
COMMENTS
Original name: a(1)=1; for n>1, a(n) = a(n-1) + 2^(j-1), where j = prime(n-1) is position of n-th 1 in A080339.
Or, take an initial segment of A080339, stopping at the n-th 1, reverse and interpret as a binary number. E.g., to get the 4th term: 11101 -> 10111 = 23, so a(4) = 23.
Indices of noncomposite terms in the sequence are 1, 2, 3, 4, 9, 310, 418, .... Next term (i.e., index of a prime), if it exists, is > 2000. See also post to SeqFan list by Tomasz Ordowski. - M. F. Hasler, Oct 30 2018
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..475
Tomasz Ordowski, Primes in primes, SeqFan list, Oct 28 2018.
FORMULA
a(n) = 1 + Sum_{k=1..n-1} 2^(prime(k)-1).
a(n) = A076793(n-1) / 2 + 1. - Georg Fischer, Aug 12 2023
MAPLE
a:=n->1+add(2^(ithprime(k)-1), k=1..n-1): seq(a(n), n=1..25); # Muniru A Asiru, Oct 31 2018
MATHEMATICA
RecurrenceTable[{a[1]==1, a[n] == 2^(Prime[n-1] - 1) + a[n-1]}, a, {n, 25}] (* Vincenzo Librandi, Oct 31 2018 *)
nxt[{n_, a_}]:={n+1, a+2^(Prime[n]-1)}; NestList[nxt, {1, 1}, 30][[All, 2]] (* Harvey P. Dale, Aug 07 2019 *)
PROG
(PARI) apply( A080355(n)=1+sum(i=1, n-1, 2^(prime(i)-1)), [1..50]) \\ M. F. Hasler, Oct 30 2018
(Magma) [n le 1 select 1 else Self(n-1) + 2^(NthPrime(n-1)-1): n in [1..25]]; // Vincenzo Librandi, Oct 31 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, based on information supplied by Artur Jasinski, Mar 21 2003
EXTENSIONS
More terms from Vladeta Jovovic, Mar 26 2003
STATUS
approved