OFFSET
1,4
COMMENTS
Previous name was: Golden Book's Level Leap Sequence.
x-positions a(n) of transition from phase 1 (I I) to 2 (/\) for the Golden Book’s y-position n.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Armands Strazds, The Golden Book, 1990. [broken link]
Index entries for linear recurrences with constant coefficients, signature (2,0,0,1,-2).
FORMULA
a(n) = 2 * a(n - 1) + r((n - 1) % 4); r = array(1, -1, 0, -1).
From Colin Barker, Apr 09 2015: (Start)
a(n) = 2*a(n-1)+a(n-4)-2*a(n-5) for n>5.
a(n) = (5+5*(-1)^n-(1+2*i)*(-i)^n-(1-i*2)*i^n+2^(1+n))/20 for n>0 where i=sqrt(-1).
G.f.: -x^2*(x^3+x-1) / ((x-1)*(x+1)*(2*x-1)*(x^2+1)).
(End)
MATHEMATICA
Join[{0}, LinearRecurrence[{2, 0, 0, 1, - 2}, {1, 1, 2, 3, 7}, 50]] (* Vincenzo Librandi, Dec 25 2015 *)
PROG
(PHP) $r = array(1, -1, 0, -1);
$a[0] = 0;
for ($n = 1; $n < 40; $n++) {
$a[$n] = 2 * $a[$n - 1] + $r[($n - 1) % 4];
}
echo(implode(", ", $a));
(PARI) concat(0, Vec(-x^2*(x^3+x-1)/((x-1)*(x+1)*(2*x-1)*(x^2+1)) + O(x^100))) \\ Colin Barker, Apr 09 2015
(Magma) I:=[0, 1, 1, 2, 3, 7]; [n le 6 select I[n] else 2*Self(n-1)+Self(n-4)-2*Self(n-5): n in [1..40]]; // Vincenzo Librandi, Dec 25 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Armands Strazds, Mar 30 2015
EXTENSIONS
New name (using g.f. from Colin Barker) from Joerg Arndt, Dec 26 2015
STATUS
approved