OFFSET
1,3
COMMENTS
Sequence only consists of 0, 1, 4 mod 5.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 0, -1, 1, 0, -1, 1, 0, -1, 1, 0, -1, 1).
FORMULA
a(n)= +a(n-1) -a(n-3) +a(n-4) -a(n-6) +a(n-7) -a(n-9) +a(n-10) -a(n-12) +a(n-13). - R. J. Mathar, Jul 27 2010
EXAMPLE
a(2)=1 because A046195(2)=6=1 mod 5.
MAPLE
A046195 := proc(n) option remember; if n <= 7 then op(n, [1, 6, 49, 961, 8214, 70225, 1385329 ]) ; else procname(n-1)+1442*procname(n-3) -1442*procname(n-4)-procname(n-6) +procname(n-7) ; end if; end proc:
# R. J. Mathar, Jul 27 2010
MATHEMATICA
LinearRecurrence[{1, 0, -1, 1, 0, -1, 1, 0, -1, 1, 0, -1, 1}, {1, 1, 4, 1, 4, 0, 4, 0, 4, 0, 4, 1, 4}, 100] (* Vincenzo Librandi, Aug 07 2015 *)
PROG
(Magma) I:=[1, 1, 4, 1, 4, 0, 4, 0, 4, 0, 4, 1, 4]; [n le 13 select I[n] else + Self(n-1) - Self(n-3) + Self(n-4) - Self(n-6) + Self(n-7) - Self(n-9) + Self(n-10) - Self(n-12) + Self(n-13): n in [1..100]]; // Vincenzo Librandi, Aug 07 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, May 30 2003
EXTENSIONS
More terms from R. J. Mathar, Jul 27 2010
STATUS
approved