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.
%I A015910 #74 Sep 08 2022 08:44:40 %S A015910 0,0,2,0,2,4,2,0,8,4,2,4,2,4,8,0,2,10,2,16,8,4,2,16,7,4,26,16,2,4,2,0, %T A015910 8,4,18,28,2,4,8,16,2,22,2,16,17,4,2,16,30,24,8,16,2,28,43,32,8,4,2, %U A015910 16,2,4,8,0,32,64,2,16,8,44,2,64,2,4,68,16,18,64,2,16,80,4,2,64 %N A015910 a(n) = 2^n mod n. %C A015910 2^n == 2 mod n if and only if n is a prime or a member of A001567 or of A006935. [Guy]. - _N. J. A. Sloane_, Mar 22 2012; corrected by _Thomas Ordowski_, Mar 26 2016 %C A015910 Known solutions to 2^n == 3 (mod n) are given in A050259. %C A015910 This sequence is conjectured to include every integer k >= 0 except k = 1. A036236 includes a proof that k = 1 is not in this sequence, and n = A036236(k) solves a(n) = k for all other 0 <= k <= 1000. - _David W. Wilson_, Oct 11 2011 %C A015910 It could be argued that a(0) := 1 would make sense, e.g., thinking of "mod n" as "in Z/nZ", and/or because (anything)^0 = 1. See also A112987. - _M. F. Hasler_, Nov 09 2018 %D A015910 Richard K. Guy, Unsolved Problems in Number Theory, F10. %H A015910 T. D. Noe, <a href="/A015910/b015910.txt">Table of n, a(n) for n=1..10000</a> %H A015910 Albert Frank, <a href="http://www.paulcooijmans.com/oth/intcont2003.html">International Contest Of Logical Sequences</a>, 2002 - 2003. Item 4 %H A015910 Albert Frank, <a href="http://www.paulcooijmans.com/oth/intcont2003ans.html">Solutions of International Contest Of Logical Sequences</a>, 2002 - 2003. %H A015910 Peter L. Montgomery, <a href="http://www.cs.ucla.edu/~klinger/newno.html">65-digit solution</a>. %F A015910 a(2^k) = 0. - _Alonso del Arte_, Nov 10 2014 %F A015910 a(n) == 2^(n-phi(n)) mod n, where phi(n) = A000010(n). - _Thomas Ordowski_, Mar 26 2016 %e A015910 a(7) = 2 because 2^7 = 128 = 2 mod 7. %e A015910 a(8) = 0 because 2^8 = 256 = 0 mod 8. %e A015910 a(9) = 8 because 2^9 = 512 = 8 mod 9. %p A015910 A015910 := n-> modp(2 &^ n,n) ; # _Zerinvary Lajos_, Feb 15 2008 %t A015910 Table[PowerMod[2, n, n], {n, 85}] %o A015910 (Maxima) makelist(power_mod(2, n, n), n, 1, 84); /* _Bruno Berselli_, May 20 2011 */ %o A015910 (PARI) a(n)=lift(Mod(2,n)^n) \\ _Charles R Greathouse IV_, Jul 15 2011 %o A015910 (Haskell) %o A015910 import Math.NumberTheory.Moduli (powerMod) %o A015910 a015910 n = powerMod 2 n n -- _Reinhard Zumkeller_, Oct 17 2015 %o A015910 (Magma) [Modexp(2, n, n): n in [1..100]]; // _Vincenzo Librandi_, Nov 09 2018 %Y A015910 Cf. A036236, A015911, A015921, A001567. %Y A015910 Cf. A000079, A062173, A082495. %K A015910 nonn %O A015910 1,3 %A A015910 _Robert G. Wilson v_