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”).
%I #42 Jan 05 2023 03:13:29
%S 1,2,5,8,15,31,62,124,248,496,992,1984,3968,7936,15872,31744,63488,
%T 126976,253952,507904,1015808,2031616,4063232,8126464,16252928,
%U 32505856,65011712,130023424,260046848,520093696,1040187392,2080374784,4160749568,8321499136
%N a(1) = 1, a(2) = 2, a(3) = 5, a(4) = 8 and a(5) = 15, a(n) = Sum_{j=1..n-1} a(j).
%C 31 is the only prime after 5 (the remaining terms are even).
%H G. C. Greubel, <a href="/A257548/b257548.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (2).
%F For n>=6, a(n) = 31*2^(n-6).
%F For n>=6, a(n) = A206371(n-6) - 1.
%F G.f.: x*(1+x^2-2*x^3-x^4+x^5)/(1-2*x). - _Robert G. Wilson v_, May 05 2015
%F E.g.f.: (31/64)*exp(2*x) + x/32 + x^2/32 + 3*x^3/16 + x^4/96 - x^5/240. - _G. C. Greubel_, Jan 05 2023
%t Join[{1,2,5,8,15}, Table[31*2^(n-6), {n,6,50}]] (* _Vincenzo Librandi_, May 03 2015 *)
%t CoefficientList[ Series[(x^5 -x^4 -2x^3 +x^2 +1)/(1 -2x), {x, 0, 33}], x] (* _Robert G. Wilson v_, May 05 2015 *)
%t Join[{1,2,5,8,15},NestList[2#&,31,30]] (* _Harvey P. Dale_, Oct 09 2018 *)
%o (Magma) [1,2,5,8] cat [31*2^n div 64: n in [5..50]]; // _Vincenzo Librandi_, May 03 2015
%o (SageMath)
%o def A257548(n): return (4*fibonacci(n+1) -3 -(-1)^n)/2 if (n<6) else 31*2^(n-6)
%o [A257548(n) for n in range(1,51)] # _G. C. Greubel_, Jan 05 2023
%Y Cf. A206371.
%K nonn,easy
%O 1,2
%A _Giovanni Teofilatto_, Apr 29 2015