login
A267317
a(n) = final digit of 2^n-1.
1
0, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5, 1, 3, 7, 5
OFFSET
0,3
COMMENTS
Decimal expansion of 25/1818.
Period 4: repeat [1, 3, 7, 5] for n > 0.
FORMULA
G.f.: x*(1 + 2*x + 5*x^2)/(1 - x + x^2 - x^3).
a(n) = A010879(A000225(n)).
a(n) = A000689(n) - 1.
a(n) = (1+(-1)^n)*(-1)^(n*(n-1)/2)/2 + 3*(1-(-1)^n)*(-1)^(n*(n+1)/2)/2 + 4 for n > 0, a(0) = 0. [Bruno Berselli, Jan 13 2016]
From Wesley Ivan Hurt, Jun 15 2016: (Start)
a(n) = a(n-4) for n>4.
a(2k+2) = A010703(k), a(2k+1) = A010688(k). (End)
From Wesley Ivan Hurt, Jul 06 2016: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n > 3.
a(n) = 4 + cos(n*Pi/2) - 3*sin(n*Pi/2) for n > 0. (End)
E.g.f.: -5 + cos(x) - 3*sin(x) + 4*exp(x). - Ilya Gutkovskiy, Jul 06 2016
MAPLE
A267317:=n->(2^n-1) mod 10: seq(A267317(n), n=0..150); # Wesley Ivan Hurt, Jun 15 2016
MATHEMATICA
Table[Mod[2^n - 1, 10], {n, 0, 120}]
PROG
(Magma) [0] cat &cat[[1, 3, 7, 5]^^25]; // Bruno Berselli, Jan 13 2016
(PARI) a(n) = if(n==0, 0, if(n%4==0, 5, if(n%4==1, 1, if(n%4==2, 3, if(n%4==3, 7))))) \\ Felix Fröhlich, Jan 19 2016
(PARI) a(n) = lift(Mod(2^n-1, 10)) \\ Felix Fröhlich, Jan 19 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Ilya Gutkovskiy, Jan 13 2016
STATUS
approved