login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(0) = 5, a(1) = 2; for n>1, a(n) = 2*a(n-1) + a(n-2).
2

%I #58 Oct 13 2016 04:41:10

%S 5,2,9,20,49,118,285,688,1661,4010,9681,23372,56425,136222,328869,

%T 793960,1916789,4627538,11171865,26971268,65114401,157200070,

%U 379514541,916229152,2211972845,5340174842,12892322529,31124819900,75141962329,181408744558,437959451445

%N a(0) = 5, a(1) = 2; for n>1, a(n) = 2*a(n-1) + a(n-2).

%C After the first two terms, there are no primes in this sequence. In fact:

%C a(12*k) is divisible by 5,

%C a(12*k+1) is divisible by 2,

%C a(12*k+2) is divisible by 3,

%C a(12*k+3) is divisible by 2,

%C a(12*k+4) is divisible by 7,

%C a(12*k+5) is divisible by 2,

%C a(12*k+6) is divisible by 3,

%C a(12*k+7) is divisible by 2,

%C a(12*k+8) is divisible by 11,

%C a(12*k+9) is divisible by 2,

%C a(12*k+10) is divisible by 3,

%C a(12*k+11) is divisible by 2.

%C Therefore, every term is divisible by 2, 3, 5, 7 or 11.

%H Colin Barker, <a href="/A276849/b276849.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,1).

%F From _Colin Barker_, Oct 11 2016: (Start)

%F G.f.: (5-8*x) / (1-2*x-x^2).

%F a(n) = ((1 + sqrt(2))^n*(-3 + 5*sqrt(2)) + (1 - sqrt(2))^n*(3 + 5*sqrt(2)))/(2*sqrt(2)). (End)

%t CoefficientList[Series[(5 - 8*x)/(1 - 2*x - x^2), {x, 0, 30}], x] (* _Wesley Ivan Hurt_, Oct 11 2016 *)

%t a[0] = 5; a[1] = 2; a[n_] := a[n] = 2 a[n - 1] + a[n - 2]; Array[a, 31, 0] (* or *) LinearRecurrence[{2, 1}, {5, 2}, 31] (* _Robert G. Wilson v_, Oct 12 2016 *)

%o (PARI) lista(n)=n++;my(v=vector(max(2,n)));v[1]=5;v[2]=2;for(i=3,n,v[i]=2*v[i-1]+v[i-2]);v \\ _David A. Corneth_, Oct 11 2016

%o (PARI) Vec((5-8*x)/(1-2*x-x^2) + O(x^40)) \\ _Colin Barker_, Oct 11 2016

%Y Cf. A277369.

%K nonn,easy

%O 0,1

%A _Bobby Jacobs_, Oct 11 2016

%E More terms from _David A. Corneth_, Oct 11 2016