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 A385989 #10 Jul 16 2025 14:35:43 %S A385989 2,3,5,5,9,8,10,9,15,14,21,14,25,17,19,17,25,24,37,24,27,32,34,26,45, %T A385989 38,45,31,57,34,36,33,43,42,47,42,73,56,51,44,61,48,57,54,57,57,70,50, %U A385989 70,70,59,64,105,72,75,59,75,86,117,64,121,67,69,65,77,76 %N A385989 a(n) is the least m > n such that 2^n and 2^m are congruent modulo n. %H A385989 Rémy Sigrist, <a href="/A385989/b385989.txt">Table of n, a(n) for n = 1..10000</a> %F A385989 a(2^k) = 2^k + 1 for any k >= 0. %F A385989 a(n) <= n + A007733(n). %t A385989 a[n_]:=Module[{m=n+1},While[PowerMod[2,n,n]!=PowerMod[2,m,n], m++]; m]; Array[a,66] (* _Stefano Spezia_, Jul 16 2025 *) %o A385989 (PARI) a(n) = { my (u = Mod(2, n)^n, v = u); for (m = n+1, oo, if (u==v*=2, return (m));); } %Y A385989 See A270096 for a similar sequence. %Y A385989 Cf. A007733. %K A385989 nonn %O A385989 1,1 %A A385989 _Rémy Sigrist_, Jul 14 2025