[go: up one dir, main page]

login
a(n) = final digit of 2^n-1.
1

%I #29 Sep 08 2022 08:46:15

%S 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,

%T 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,

%U 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

%N a(n) = final digit of 2^n-1.

%C Decimal expansion of 25/1818.

%C Period 4: repeat [1, 3, 7, 5] for n > 0.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/MersenneNumber.html">Mersenne Number</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1).

%F G.f.: x*(1 + 2*x + 5*x^2)/(1 - x + x^2 - x^3).

%F a(n) = A010879(A000225(n)).

%F a(n) = A000689(n) - 1.

%F 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]

%F From _Wesley Ivan Hurt_, Jun 15 2016: (Start)

%F a(n) = a(n-4) for n>4.

%F a(2k+2) = A010703(k), a(2k+1) = A010688(k). (End)

%F From _Wesley Ivan Hurt_, Jul 06 2016: (Start)

%F a(n) = a(n-1) - a(n-2) + a(n-3) for n > 3.

%F a(n) = 4 + cos(n*Pi/2) - 3*sin(n*Pi/2) for n > 0. (End)

%F E.g.f.: -5 + cos(x) - 3*sin(x) + 4*exp(x). - _Ilya Gutkovskiy_, Jul 06 2016

%p A267317:=n->(2^n-1) mod 10: seq(A267317(n), n=0..150); # _Wesley Ivan Hurt_, Jun 15 2016

%t Table[Mod[2^n - 1, 10], {n, 0, 120}]

%o (Magma) [0] cat &cat[[1, 3, 7, 5]^^25]; // _Bruno Berselli_, Jan 13 2016

%o (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

%o (PARI) a(n) = lift(Mod(2^n-1, 10)) \\ _Felix Fröhlich_, Jan 19 2016

%Y Cf. A000225, A000689, A010688, A010703, A010879, A080172.

%K nonn,base,easy

%O 0,3

%A _Ilya Gutkovskiy_, Jan 13 2016