OFFSET
1,2
LINKS
Marian Kraus, Illustration for a(4)
FORMULA
Conjectured recurrence:
a(0)=1,
a(1)=8,
a(2)=20, and thereafter
a(n)=2*a(n-2)+20.
Conjectured formula: ("[]" is the floor function)
a(n)=4*sum_{k=1}^{[(n+1)/2]}(2^k)+6*sum_{k=1}^{[n/2]}(2^k).
Conjectures from Colin Barker, Dec 07 2015: (Start)
a(n) = (-20+2^(1/2*(-1+n))*(10-10*(-1)^n+7*sqrt(2)+7*(-1)^n*sqrt(2))) for n>1.
a(n) = 5*2^(n/2+1/2)-5*(-1)^n*2^(n/2+1/2)+7*2^(n/2)+7*(-1)^n*2^(n/2)-20 for n>1.
a(n) = a(n-1)+2*a(n-2)-2*a(n-3) for n>4.
G.f.: x*(1+7*x+10*x^2+2*x^3) / ((1-x)*(1-2*x^2)).
(End)
EXAMPLE
By recursion:
a(3)=2*a(1)+20=2*8+20=36
a(4)=2*a(2)+20=2*20+20=60
By function:
a(3)=4*sum_{k=1}^{[(3+1)/2]}(2^k)+6*sum_{k=1}^{[3/2]}(2^k)
=4*sum_{k=1}^{[2]}(2^k)+6*sum_{k=1}^{[1.5]}(2^k)
=4*sum_{k=1}^{2}(2^k)+6*sum_{k=1}^{1}(2^k)
=4*(2^1+2^2)+6*(2^1)
=4*(2+4)+6*(2)=24+12=36
a(4)=4*sum_{k=1}^{[(4+1)/2]}(2^k)+6*sum_{k=1}^{[4/2]}(2^k)
=4*sum_{k=1}^{[2.5]}(2^k)+6*sum_{k=1}^{[2]}(2^k)
=4*sum_{k=1}^{2}(2^k)+6*sum_{k=1}^{2}(2^k)
=4*(2^1+2^2)+6*(2^1+2^2)
=4*(2+4)+6*(2+4)=24+36=60
PROG
(R)
rm(a)
a <- vector() powerof2 <- vector()
x <- 300
n <- x/2
for (i in 1:x){
powerof2[i] <- 2^(i-1)}
powerof2 for (i in 1:n){
a[2*i] <- 8*(sum(powerof2[1:i]))+12*(sum(powerof2[1:i]))}
for (i in 1:(n+1)){
a[2*i+1] <- 8*(sum(powerof2[1:(i+1)]))+12*(sum(powerof2[1:i]))}
a[1]<-8
a
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Marian Kraus, Dec 04 2015
STATUS
approved