login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A176496 a(n) = Sum_{k=1..n} 2^nonprime(k). 1

%I #10 Feb 14 2023 17:54:08

%S 2,18,82,338,850,1874,5970,22354,55122,120658,382802,1431378,3528530,

%T 7722834,24500050,58054482,125163346,259381074,527816530,1601558354,

%U 5896525650,14486460242,31666329426,66026067794,134745544530,409623451474,959379265362,2058890893138

%N a(n) = Sum_{k=1..n} 2^nonprime(k).

%H Andrew Howroyd, <a href="/A176496/b176496.txt">Table of n, a(n) for n = 1..500</a>

%F a(1) = 2, a(n) = a(n-1) + 2^A018252(n).

%e a(2) = 2 + 2^A018252(2) = 2 + 2^4 = 18 ; a(3) = 18 + 2^A018252(3) = 18 + 2^6 = 82.

%t With[{t=Select[Range[50],!PrimeQ[#]&]},Accumulate[2^t]] (* _Harvey P. Dale_, Feb 14 2023 *)

%o (PARI) a(n) = my(s = 0, k = 1); while(n, if(!isprime(k), s += 2^k; n--); k++); return(s)

%Y Cf. A076793, A018252.

%K easy,nonn

%O 1,1

%A David Lazar (lazar6(AT)illinois.edu), Apr 19 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)