login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A213859
a(n) = 2^n mod (n+2).
5
1, 2, 0, 3, 4, 4, 0, 2, 6, 6, 4, 7, 8, 2, 0, 9, 16, 10, 4, 2, 12, 12, 16, 8, 14, 20, 4, 15, 16, 16, 0, 2, 18, 22, 16, 19, 20, 2, 24, 21, 16, 22, 4, 38, 24, 24, 16, 32, 6, 2, 4, 27, 34, 52, 8, 2, 30, 30, 4, 31, 32, 2, 0, 8, 16, 34, 4, 2, 46, 36, 16, 37, 38, 17
OFFSET
0,2
COMMENTS
Conjectures:
1. Indices of zeros: 2^(x+2)-2, x >= 0.
2. There are infinitely many n's such that a(n)=n.
3. Every integer k >= 0 appears in a(n) at least once.
4. Every k >= 0 appears in a(n) infinitely many times.
LINKS
FORMULA
a(n) = 2^n mod (n+2).
a(n) = A106262(2*n, n). - G. C. Greubel, Jan 11 2023
MATHEMATICA
Table[PowerMod[2, n, n+2], {n, 0, 100}] (* T. D. Noe, Jun 26 2012 *)
PROG
(Python)
print([2**n % (n+2) for n in range(222)])
(Magma) [Modexp(2, n, n+2): n in [0..120]]; // G. C. Greubel, Jan 11 2023
(SageMath) [power_mod(2, n, n+2) for n in range(121)] # G. C. Greubel, Jan 11 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Jun 22 2012
STATUS
approved