OFFSET
0,1
COMMENTS
Using this definition of a(k) we (formally) work backwards towards a(2)=5 to arrive at the formula for a(k) below.
For k >= 3, a(k) has the simple form a(k) = 2^(k-2)*(4 + (1 + (-1)^(k+1))/2) + 1; and it follows by induction that a(k) is congruent to 17 (mod 24) for all k >= 4. Direct calculations show that for k >= 3, the discriminants of the polynomials x^2 + x + a(k), D(k) = 1 - 4*a(k), satisfy the functional equation -D(k) = a(k+2) + 2.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
FORMULA
(a(k))_(k>=0) = 2^(k-2)*(4 + Sum_{r=2..k-1} (-1)^r) + 1, the empty sums corresponding to k=0, 1, 2 of course taken to be zero.
a(n) = A056486(n-1) + 1. - Ralf Stephan, Mar 19 2004
From Georg Fischer, May 15 2019: (Start)
a(2*n) = 2^n + 1.
G.f.: (2+x-6*x^2+2*x^3-2*x^4)/((1-x)*(1-2*x)*(1+2*x)). (End)
MAPLE
aList := proc(len) local egf, ser, n;
egf := (exp(-2*x) + 9*exp(2*x) - 10)/4; ser := series(egf, x, len + 2);
[2, 3, 5, seq(1 + n!*coeff(ser, x, n), n = 2..len)] end:
aList(30); # Peter Luschny, Mar 23 2024
MATHEMATICA
LinearRecurrence[{1, 4, -4}, {2, 3, 5, 11, 17}, 32] (* Georg Fischer, May 15 2019 *)
PROG
(PARI) a(n)=if(n<2, if(n<1, 2, 3), if(n%2==0, 4^(n/2)+1, 5/2*4^((n-1)/2)+1))
(Magma)
A082605:= func< n | n le 1 select n+2 else 2^(n-3)*(9-(-1)^n) +1 >;
[A082605(n): n in [0..40]]; // G. C. Greubel, Mar 23 2024
(SageMath)
def A082605(n): return 1 + 2^(n-3)*(9-(-1)^n) -int(n==1)/2
[A082605(n) for n in range(41)] # G. C. Greubel, Mar 23 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Johan Meyer and Ben de la Rosa (meyerjh.sci(AT)mail.uovs.ac.za), May 23 2003
EXTENSIONS
More terms from Ralf Stephan, Mar 19 2004
STATUS
approved