A010688 Period 2: repeat (1,7).
1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Magma
&cat[[1, 7]^^50]; // Vincenzo Librandi, Feb 07 2011 - Jul 23 2016
-
Mathematica
PadRight[{},120,{1,7}] (* Harvey P. Dale, Mar 21 2018 *)
-
PARI
a(n)=n%2*6+1 \\ Charles R Greathouse IV, Jun 11 2015
-
Sage
[power_mod(7,n,8)for n in range(0,92)] # Zerinvary Lajos, Nov 03 2009
Formula
From Paul Barry, May 23 2003: (Start)
a(n) = 4 - 3(-1)^n;
g.f.: (1+7x)/((1+x)(1-x));
e.g.f.: 4*exp(x)-3*exp(-x). (End)
a(n) = 7^n mod 8. - Vincenzo Librandi, Feb 07 2011
Extensions
Formula corrected by Philippe Deléham, Oct 30 2008
Comments