OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1).
FORMULA
For n > 50: a(n) = a(n-1) - a(n-50) + a(n-51).
G.f.: (1 + x + 2x^2 + 4x^3 + 8x^4 + 16x^5 + 32x^6 - 61x^7 + 3x^8 + 6x^9 + 12x^10 + 24x^11 + 48x^12 - 29x^13 - 58x^14 + 9x^15 + 18x^16 + 36x^17 - 53x^18 + 19x^19 + 38x^20 - 49x^21 + 27x^22 + 54x^23 - 17x^24 - 34x^25 + 57x^26 - 11x^27 - 22x^28 - 44x^29 + 37x^30 - 51x^31 + 23x^32 + 46x^33 - 33x^34 + 59x^35 - 7x^36 - 14x^37 - 28x^38 - 56x^39 + 13x^40 + 26x^41 + 52x^42 - 21x^43 - 42x^44 + 41x^45 - 43x^46 + 39x^47 - 47x^48 + 31x^49 + 63x^50) / ((1-x)*(1+x^2)*(1 - x^2 + x^4 - x^6 + x^8 - x^10 + x^12 - x^14 + x^16 - x^18 + x^20 - x^22 + x^24 - x^26 + x^28 - x^30 + x^32 - x^34 + x^36 - x^38 + x^40 - x^42 + x^44 - x^46 + x^48)).
Periodic with period 100.
EXAMPLE
a(7) = 2^7 mod 125 = 3.
MATHEMATICA
PowerMod[2, Range[0, 100], 125] (* Harvey P. Dale, Aug 12 2013 *)
PROG
(PARI) a(n)=lift(Mod(2, 125)^n) \\ Charles R Greathouse IV, Mar 22 2016
(Magma) [Modexp(2, n, 125): n in [0..120]]; // G. C. Greubel, Oct 17 2018
(GAP) a:=List([0..100], n->PowerMod(2, n, 125));; Print(a); # Muniru A Asiru, Jan 27 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Franz Vrabec, Dec 06 2011
STATUS
approved