This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A175104 a(1)=1. For n >= 2, a(n) = 2*a(n-1) + (number of composites among first n-1 terms of the sequence). 1

%I

%S 1,2,4,9,20,43,89,181,365,734,1473,2952,5911,11830,23669,47347,94704,

%T 189419,378850,757713,1515440,3030895,6061806,12123629,24247276,

%U 48494571,96989162,193978345,387956712,775913447,1551826917,3103653858

%N a(1)=1. For n >= 2, a(n) = 2*a(n-1) + (number of composites among first n-1 terms of the sequence).

%H Harvey P. Dale, <a href="/A175104/b175104.txt">Table of n, a(n) for n = 1..1000</a>

%p A175104 := proc(n) option remember; if n = 1 then 1; else a := 2*procname(n-1) ; for i from 1 to n-1 do prev := procname(i) ; if prev > 2 and not isprime(prev) then a := a+1 ; end if; end do ; a ; end if; end proc: seq(A175104(n),n=1..70) ; # _R. J. Mathar_, Feb 16 2010

%t nxt[{a_,c_}]:=Module[{t=2a+c},{t,c+If[CompositeQ[t],1,0]}]; Transpose[ NestList[ nxt,{1,0},40]][[1]] (* _Harvey P. Dale_, Mar 07 2015 *)

%K nonn,changed

%O 1,2

%A _Leroy Quet_, Feb 09 2010

%E More terms from _R. J. Mathar_, Feb 16 2010

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

Last modified January 22 10:32 EST 2019. Contains 319363 sequences. (Running on oeis4.)