OFFSET
1,2
COMMENTS
Length of period of sequences r(k,n) = floor(sinh(1)*k!) - n*floor(sinh(1)*k!/n) when n is fixed. - Benoit Cloitre, Jun 22 2003
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
O.g.f.: (x+2x^2+4x^3-x^5)/(1-x^2)^2. - Len Smiley, Dec 05 2001
a(n)*a(n+3) = -4 + a(n+1)*a(n+2).
From Harry J. Smith, Nov 08 2009: (Start)
a(n) = A109043(n), n > 1.
a(n) = 2*A026741(n), n > 1. (End)
EXAMPLE
r(k,7) is sequence 1, 2, 0, 0, 1, 6, 1, 1, 3, 2, 2, 3, 5, 0, 1, 2, 0, 0, 1, 6, 1, 1, 3, 2, 2, 3, 5, 0.... which is periodic with period (1, 2, 0, 0, 1, 6, 1, 1, 3, 2, 2, 3, 5, 0) of length 14 = a(7).
MATHEMATICA
Join[{1}, LCM[Range[2, 100], 2]] (* Paolo Xausa, Feb 19 2024 *)
PROG
(PARI) a(n)=if(n<2, 1, if(n%2, 2*n, n))
(PARI) { for (n=1, 1000, a=if (n>1 && n%2, 2*n, n); write("b066043.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 08 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
George E. Antoniou, Nov 30 2001
STATUS
approved