login
A269266
a(n) = 2^n mod 31.
2
1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1, 2, 4, 8, 16, 1
OFFSET
0,2
REFERENCES
Continued fraction expansion of (1651+sqrt(3236405))/2386. - Bruno Berselli, Mar 31 2016
FORMULA
G.f.: (1 + 2*x + 4*x^2 + 8*x^3 + 16*x^4)/(1 - x^5).
a(n) = a(n-5).
a(n) = 2^(n mod 5). - Bruno Berselli, Mar 31 2016
MATHEMATICA
PowerMod[2, Range[0, 100], 31]
PROG
(Magma) [Modexp(2, n, 31): n in [0..100]];
(Magma) &cat [[1, 2, 4, 8, 16]^^20] // Bruno Berselli, Mar 31 2016
(PARI) a(n)=2^(n%5) \\ Charles R Greathouse IV, Mar 31 2016
(PARI) x='x+O('x^99); Vec((1+2*x+4*x^2+8*x^3+16*x^4)/(1-x^5)) \\ Altug Alkan, Mar 31 2016
(Sage) [2^mod(n, 5) for n in (0..100)] # Bruno Berselli, Mar 31 2016
(Python) for n in range(0, 100):print(2**n%31) # Soumil Mandal, Apr 03 2016
(Python) def A269266(n): return pow(2, n, 31) # Chai Wah Wu, Jan 03 2022
(GAP) List([0..70], n->PowerMod(2, n, 31)); # Muniru A Asiru, Jan 30 2019
CROSSREFS
Cf. A201912 (11th row of the triangle).
Cf. similar sequences of the type 2^n mod p, where p is a prime: A000034 (p=3), A070402 (p=5), A069705 (p=7), A036117 (p=11), A036118 (p=13), A062116 (p=17), A036120 (p=19), A070335 (p=23), A036122 (p=29), this sequence (p=31), A036124 (p=37), A070348 (p=41), A070349 (p=43), A070351 (p=47), A036128 (p=53), A036129 (p=59), A036130 (p=61), A036131 (p=67).
Sequence in context: A002546 A289089 A010745 * A317506 A317501 A097777
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Mar 31 2016
STATUS
approved