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”).

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
1, 2, 4, 9, 20, 43, 89, 181, 365, 734, 1473, 2952, 5911, 11830, 23669, 47347, 94704, 189419, 378850, 757713, 1515440, 3030895, 6061806, 12123629, 24247276, 48494571, 96989162, 193978345, 387956712, 775913447, 1551826917, 3103653858
OFFSET
1,2
LINKS
MAPLE
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
MATHEMATICA
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 *)
CROSSREFS
Sequence in context: A018102 A018103 A350092 * A123720 A179744 A266930
KEYWORD
nonn
AUTHOR
Leroy Quet, Feb 09 2010
EXTENSIONS
More terms from R. J. Mathar, Feb 16 2010
STATUS
approved