A294390 a(n) = 2^(n-4) mod n, for n >= 4.
1, 2, 4, 1, 0, 5, 4, 7, 4, 5, 2, 8, 0, 15, 4, 12, 16, 11, 14, 3, 16, 2, 10, 5, 8, 11, 4, 4, 0, 17, 30, 23, 4, 14, 24, 20, 16, 36, 4, 27, 12, 32, 6, 6, 16, 8, 14, 26, 40, 20, 22, 13, 16, 29, 22, 37, 16, 23, 8, 32, 0, 2, 4, 42, 52, 35, 64, 9, 40, 64, 28, 23, 20, 30, 4
Offset: 4
Examples
For n=9, 2^5 = 32 == 5 mod 9.
Links
- Robert Israel, Table of n, a(n) for n = 4..10000
- Enrique Navarrete, Sequences derived from residues of 2^n (mod n)
Programs
-
Magma
[Modexp(2, n-4, n): n in [4..120]]; // G. C. Greubel, Dec 27 2024
-
Maple
A294390:=n->2&^(n-4) mod n: seq(A294390(n), n=4..150); # Wesley Ivan Hurt, Nov 30 2017
-
Mathematica
Array[Mod[2^(# - 4), #] &, 75, 4] (* Michael De Vlieger, Dec 02 2017 *) Array[PowerMod[2,#-4,#]&,80,4] (* Harvey P. Dale, Dec 01 2018 *)
-
PARI
a(n) = lift(Mod(2, n)^(n-4)); \\ Michel Marcus, Oct 30 2017
-
SageMath
print([power_mod(2, n-4, n) for n in range(4, 101)]) # G. C. Greubel, Dec 27 2024
Extensions
More terms from Michel Marcus, Oct 30 2017
Comments