|
|
A080355
|
|
a(1)=1; thereafter, a(n+1) = a(n) + 2^(prime(n)-1).
|
|
22
|
|
|
1, 3, 7, 23, 87, 1111, 5207, 70743, 332887, 4527191, 272962647, 1346704471, 70066181207, 1169577808983, 5567624320087, 75936368497751, 4579535995868247, 292809912147579991, 1445731416754426967, 75232707711592633431, 1255824328429003936855, 5978190811298649150551
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
FORMULA
|
a(n) = 1 + Sum_{k=1..n-1} 2^(prime(k)-1).
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|