A269266 a(n) = 2^n mod 31.
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
References
- Continued fraction expansion of (1651+sqrt(3236405))/2386. - Bruno Berselli, Mar 31 2016
Links
- Muniru A Asiru, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,1).
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).
Programs
-
GAP
List([0..70],n->PowerMod(2,n,31)); # Muniru A Asiru, Jan 30 2019
-
Magma
[Modexp(2, n, 31): n in [0..100]];
-
Magma
&cat [[1,2,4,8,16]^^20] // Bruno Berselli, Mar 31 2016
-
Mathematica
PowerMod[2, Range[0, 100], 31]
-
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
-
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
-
Sage
[2^mod(n,5) for n in (0..100)] # 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
Comments