cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A177023 a(n) = 2^(2*n) mod (2*n+1).

This page as a plain text file.
%I A177023 #23 Jan 15 2018 14:01:05
%S A177023 1,1,1,4,1,1,4,1,1,4,1,16,13,1,1,4,9,1,4,1,1,31,1,15,4,1,49,4,1,1,4,
%T A177023 16,1,4,1,1,34,9,1,40,1,16,4,1,64,4,54,1,58,1,1,46,1,1,4,1,39,22,30,
%U A177023 56,4,91,1,4,1,64,94,1,1,4,114,16,25,1,1,103,109,1,4,156,1,16,1,40,85,1,134
%N A177023 a(n) = 2^(2*n) mod (2*n+1).
%C A177023 It is known that a(n) equals 1 when 2*n+1 is prime as a result of Fermat's little theorem. If not then a(n) equals 1 when 2*n+1 is a pseudoprime to base 2.
%H A177023 Alois P. Heinz, <a href="/A177023/b177023.txt">Table of n, a(n) for n = 1..20000</a> (first 5000 terms from Muniru A Asiru)
%H A177023 Wikipedia, <a href="http://en.wikipedia.org/wiki/Fermat%27s_little_theorem">Fermat's little theorem</a>
%F A177023 a(n) = 2^(2*n) mod (2*n+1) or a(n) = 4^n mod (2*n+1)
%e A177023 a(3) = 2^(2 * 3) mod (2 * 3 + 1) = 64 mod 7 = 1.
%e A177023 a(4) = 2^(2 * 4) mod (2 * 4 + 1) = 256 mod 9 = 4.
%e A177023 a(5) = 2^(2 * 5) mod (2 * 5 + 1) = 1024 mod 11 = 1.
%p A177023 seq(2&^(2*n) mod (2*n + 1), n=1..10^2); # _Muniru A Asiru_, Jan 14 2018
%t A177023 Table[PowerMod[2, 2n, 2n + 1], {n, 90}] (* _Harvey P. Dale_, May 09 2012 *)
%o A177023 (Literate Haskell) > map (\k -> 2^(2*k) `mod` (2*k+1)) [1..100]
%o A177023 (GAP) A177023 := List([1..10^3], n -> 2^(2*n) mod (2*n + 1)); # _Muniru A Asiru_, Jan 14 2018
%o A177023 (PARI) a(n) = lift(Mod(4, 2*n+1)^n); \\ _Michel Marcus_, Jan 15 2018
%Y A177023 Cf. A000040, A001567.
%K A177023 easy,nonn
%O A177023 1,4
%A A177023 Nikolay Ulyanov (ulyanick(AT)gmail.com), May 01 2010