OFFSET
1,5
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A106262(2*n-1, n-2). - G. C. Greubel, Jan 11 2023
EXAMPLE
a(3) = 2^4 mod 3 = 16 mod 3 = 1.
MATHEMATICA
Table[PowerMod[2, n + 1, n], {n, 100}] (* T. D. Noe, Aug 13 2012 *)
PROG
(Python)
print([2**(n+1) % n for n in range(1, 77)])
# Alex Ratushnyak, Aug 12 2012
(Magma) [Modexp(2, n+1, n): n in [1..120]]; // G. C. Greubel, Jan 11 2023
(SageMath) [power_mod(2, n+1, n) for n in range(1, 120)] # G. C. Greubel, Jan 11 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Oct 08 2005
EXTENSIONS
Name, data and offset corrected by Alex Ratushnyak, Aug 12 2012
STATUS
approved