OFFSET
0,4
COMMENTS
The sequence is rather simple. It becomes more interesting if you apply other periodic correction patterns. What is also interesting that it (and related sequences like 0,1,1,0,1,1,0,1,1,0,...) was used to cryptanalyze the RC5 block-cipher since it describes the Hamming weight of a difference if at every 3rd step there is no data rotation. Since the attacker has to pay in probability to cause no rotations, the related question was how many corrected Fibonacci sequences with up to m corrections are there. The paper contains a recursive program that enumerates all "corrected" Fibonacci sequences of length N, with up to m corrections (in that case we do not restrict the locations of the corrections).
0, 1, 1, 2, 3, 5, 2, 7, 9, 16, 7, 23, 30, 53, ... = Fibonacci with corrections at every 4th step.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
A. Biryukov, Home page
A. Biryukov and E. Kushilevitz, Improved Cryptanalysis of RC5, Lecture Notes in Computer Science 1403, Proceedings of EUROCRYPT'98, pp. 85-99, 1998.
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
a(n) = a(n-1) + a(n-2); if n = 3k, n=3k+1, for k=1, 2, 3, .. a(n) = a(n-1) - a(n-2); if n = 3k+2, for k=0, 1, 2, 3, ... a(0) = 0, a(1) = 1;
G.f.: -x*(1+x)*(x^3 - 2*x^2 - 1) / ( (x-1)^2*(1 + x + x^2)^2 ). - R. J. Mathar, Dec 15 2014
a(n) = 2*a(n-3) - a(n-6). - Vincenzo Librandi, Jul 29 2017
a(n) = (1/18)*(8 + 8*n + (10-8*n)*cos(2*(n-2)*Pi/3) - sqrt(3)*sin(2*(n-2)*Pi/3) + sqrt(3)*sin(4*(n-2)*Pi/3)). - Wesley Ivan Hurt, Sep 25 2017
MATHEMATICA
CoefficientList[Series[-x (1 + x) (x^3 - 2 x^2 - 1) / ((x - 1)^2 (1 + x + x^2)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Jul 29 2017 *)
PROG
(Magma) I:=[0, 1, 1, 2, 3, 1]; [n le 6 select I[n] else 2*Self(n-3)-Self(n-6): n in [1..100]]; // Vincenzo Librandi, Jul 29 20127
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Biryukov, Apr 19 2004
STATUS
approved