cp's OEIS Frontend

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.

A385073 a(n) = b^(n-1) mod n, where b = A053669(n) is the least integer greater than 1 and coprime to n.

This page as a plain text file.
%I A385073 #35 Jun 25 2025 18:05:51
%S A385073 0,1,1,3,1,5,1,3,4,3,1,5,1,3,4,11,1,11,1,7,4,3,1,5,16,3,13,27,1,7,1,
%T A385073 11,4,3,9,29,1,3,4,27,1,17,1,27,31,3,1,29,15,33,4,27,1,11,49,3,4,3,1,
%U A385073 43,1,3,4,43,16,23,1,27,4,13,1,29,1,3,34,27,9,5,1,27,40,3,1,17
%N A385073 a(n) = b^(n-1) mod n, where b = A053669(n) is the least integer greater than 1 and coprime to n.
%C A385073 Inspired by Fermat's Little Theorem.
%C A385073 a(n) > 0 for n > 1 since n and b are coprime.
%H A385073 Wikipedia, <a href="https://en.wikipedia.org/wiki/Fermat%27s_little_theorem">Fermat's little theorem</a>
%F A385073 a(n) = 0 iff n = 1.
%F A385073 a(n) = 1 iff n belongs to A000040, A001567, or A130433.
%F A385073 a(n) = 2 iff n>1 and belongs to A173572;
%F A385073 a(n) = 4 iff n belongs to A033553;
%F A385073 a(n) = 8 iff n>7 and belongs to either A033984 or A173138;
%F A385073 a(n) = 16 iff n>15 and belongs to A276968;
%F A385073 a(n) = 32 iff n>1 and belongs to A215610;
%F A385073 a(n) = 64 iff n>63 and belongs to A276969;
%F A385073 a(n) = 128 iff n>127 and belongs to A215611;
%F A385073 a(n) = 256 iff n>255 and belongs to A276970;
%F A385073 a(n) = 512 iff n>511 and belongs to A215612;
%F A385073 a(n) = 1024 iff n>1023 and belongs to A276971;
%F A385073 a(n) = 2048 iff n>2047 and belongs to A215613;
%F A385073 From _Robert Israel_, Jun 18 2025: (Start)
%F A385073 a(2*p) = 3 if p is a prime > 3.
%F A385073 a(3*p) = 4 if p is a prime > 2.
%F A385073 a(4*p) = 3^3 if p is a prime > 5.
%F A385073 a(6*p) = 5^5 if p is a prime > 509.
%F A385073 a(8*p) = 3^5 if p is a prime > 271.
%F A385073 a(10*p) = 3^9 if p is a prime > 1951.
%F A385073 a(12*p) = 5^11 if p is a prime > 4069003. (End)
%p A385073 f:= proc(n) local b;
%p A385073   b:= 2;
%p A385073   while n mod b = 0 do b:= nextprime(b) od;
%p A385073   b &^ (n-1) mod n
%p A385073 end proc:
%p A385073 f(1):= 0:
%p A385073 map(f, [$1..100]); # _Robert Israel_, Jun 18 2025
%t A385073 a[n_] := Block[{b = 2}, While[GCD[n, b] > 1, b++]; PowerMod[b, n - 1, n]]; Array[a, 84]
%o A385073 (PARI) a(n) = forprime(p=2, , if(n%p, return(lift(Mod(p, n)^(n-1))))); \\ _Michel Marcus_, Jun 18 2025
%Y A385073 Cf. A053669, A385074.
%K A385073 nonn,look
%O A385073 1,4
%A A385073 _Robert G. Wilson v_, Jun 16 2025