login
a(n) = (2^n - 1) mod n.
10

%I #18 Dec 01 2022 10:50:07

%S 0,1,1,3,1,3,1,7,7,3,1,3,1,3,7,15,1,9,1,15,7,3,1,15,6,3,25,15,1,3,1,

%T 31,7,3,17,27,1,3,7,15,1,21,1,15,16,3,1,15,29,23,7,15,1,27,42,31,7,3,

%U 1,15,1,3,7,63,31,63,1,15,7,43,1,63,1,3,67,15,17,63,1,15,79,3,1,63,31,3,7,79

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

%H Reinhard Zumkeller, <a href="/A082495/b082495.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A015910(n) + A048298(n) - 1.

%t Table[Mod[2^m-1,m],{m,6!}] (* _Vladimir Joseph Stephan Orlovsky_, Feb 11 2010 *)

%o (PARI) vector(80, n, (2^n-1) %n) \\ _Michel Marcus_, Jan 16 2015

%o (Haskell)

%o a082495 n = a015910 n + a048298 n - 1 -- _Reinhard Zumkeller_, Oct 17 2015

%o (Python)

%o def A082495(n): return (m if (m:=pow(2,n,n)) else n)-1 # _Chai Wah Wu_, Dec 01 2022

%Y Cf. A015910, A048298.

%Y Cf. A000079, A062173.

%K easy,nonn

%O 1,4

%A Anonymous, Apr 28 2003