A010685 Period 2: repeat (1,4).
1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1
Offset: 0
Links
- Matthew House, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,1).
Programs
-
Magma
[Modexp(4,n,5): n in [0..100]]; // G. C. Greubel, Nov 22 2021
-
Maple
A010685 := proc(n) if type(n,'even') then 1 ; else 4; end if; end proc: # R. J. Mathar, Aug 03 2015
-
Mathematica
Table[(5-3(-1)^n)/2, {n, 0, 100}] (* Wesley Ivan Hurt, Mar 26 2014 *) PadRight[{},120,{1,4}] (* Harvey P. Dale, Aug 08 2022 *)
-
PARI
values(m)=my(v=[]);for(i=1,m,v=concat([1,4],v));v; /* Anders Hellström, Aug 03 2015 */
-
Sage
[power_mod(4,n,5)for n in range(0,81)] # Zerinvary Lajos, Nov 26 2009
Formula
a(2n) = 1, a(2n+1) = 4.
From Paul Barry, Jun 03 2003: (Start)
G.f.: (1+4*x)/((1-x)*(1+x)).
E.g.f.: (5*exp(x) - 3*exp(-x))/2.
a(n) = (5 - 3*(-1)^n)/2.
a(n) = 4^((1-(-1)^n)/2) = 2^(1-(-1)^n) = 2/(2^((-1)^n)).
a(n) = 4^(ceiling(n/2) - floor(n/2)). (End)
a(n) = gcd((n-1)^2, (n+1)^2). - Paul Barry, Sep 16 2004
a(n) = 4^n mod 5. - Zerinvary Lajos, Nov 26 2009
a(n) = 4^(n mod 2). - Wesley Ivan Hurt, Mar 29 2014
Comments