login
a(n) = (1 + 2^n) mod n.
6

%I #27 Sep 08 2022 08:45:14

%S 0,1,0,1,3,5,3,1,0,5,3,5,3,5,9,1,3,11,3,17,9,5,3,17,8,5,0,17,3,5,3,1,

%T 9,5,19,29,3,5,9,17,3,23,3,17,18,5,3,17,31,25,9,17,3,29,44,33,9,5,3,

%U 17,3,5,9,1,33,65,3,17,9,45,3,65,3,5,69,17,19,65,3,17,0,5,3,65,33,5,9,81,3

%N a(n) = (1 + 2^n) mod n.

%H Michael De Vlieger, <a href="/A096196/b096196.txt">Table of n, a(n) for n = 1..10000</a>

%H OEIS Wiki, <a href="/wiki/2^n mod n">2^n mod n</a>

%p seq(1 + 2 &^ n mod n, n = 1 .. 250); # _Robert Israel_, Dec 10 2015

%t Table[Mod[1 + Mod[2, n]^n, n], {n, 89}] (* _Michael De Vlieger_, Dec 10 2015 *)

%o (PARI) a(n)=(1+2^n)%n \\ _Anders Hellström_, Dec 10 2015

%o (PARI) a(n)=lift(1+Mod(2,n)^n); \\ _Michel Marcus_, Dec 12 2015

%o (Magma) [(1+2^n) mod (n): n in [1..100]]; // _Vincenzo Librandi_, Dec 11 2015

%Y Cf. A006521, A015910, A082495.

%K nonn,easy

%O 1,5

%A _Labos Elemer_, Jul 26 2004