login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Number of values of s, 0 <= s <= n-1, such that 2^s mod n = s.
2

%I #20 Aug 02 2024 17:00:01

%S 1,0,0,0,1,1,0,0,1,0,1,1,1,0,0,0,0,1,0,1,2,0,0,1,0,2,1,1,1,1,1,0,0,1,

%T 1,1,0,1,2,1,1,1,0,0,3,0,0,1,1,2,0,1,2,1,0,2,0,2,0,1,1,1,1,0,2,1,0,0,

%U 0,2,1,1,1,1,1,0,1,2,0,1,1,0,1,1,0,1,0,0,0,2,2,0,0,0,0,1,1,1,0,1,0,0,1,1,1

%N Number of values of s, 0 <= s <= n-1, such that 2^s mod n = s.

%H Michel Marcus, <a href="/A065293/b065293.txt">Table of n, a(n) for n = 1..1000</a>

%e For n=5 we have (2^0) mod 5 = 1, (2^1) mod 5 = 2, (2^2) mod 5 = 4, (2^3) mod 5 = 3, (2^4) mod 5 = 1. Only for s=3 does (2^s) mod 5=s, so a(5)=1

%t Table[Count[Range[0, n - 1], _?(Mod[2^#, n] == # &)], {n, 105}] (* _Michael De Vlieger_, Jun 19 2018 *)

%t Table[Count[Range[0,n-1],_?(PowerMod[2,#,n]==#&)],{n,110}] (* _Harvey P. Dale_, Aug 02 2024 *)

%o (PARI) a(n) = sum(s=0, n-1, Mod(2, n)^s == s); \\ _Michel Marcus_, Jun 19 2018

%Y Cf. A065294.

%K nonn

%O 1,21

%A Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 28 2001

%E a(1) corrected by _Michel Marcus_, Jun 20 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 22:57 EDT 2024. Contains 376090 sequences. (Running on oeis4.)