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.

A283149 Largest k such that (p-1)! == -1 (mod p^k), where p = prime(n).

This page as a plain text file.
%I A283149 #14 Apr 30 2021 07:01:13
%S A283149 1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%T A283149 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
%U A283149 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1
%N A283149 Largest k such that (p-1)! == -1 (mod p^k), where p = prime(n).
%C A283149 a(n) > 1 iff A002068(n) = 0, i.e., iff p is a Wilson prime (A007540).
%C A283149 Is a(n) < 3 for all n?
%H A283149 Robert Israel, <a href="/A283149/b283149.txt">Table of n, a(n) for n = 1..10000</a>
%p A283149 f:= proc(n) local p;
%p A283149   p:= ithprime(n);
%p A283149   padic:-ordp((p-1)!+1,p)
%p A283149 end proc:
%p A283149 map(f, [$1..200]); # _Robert Israel_, Apr 29 2021
%t A283149 Table[With[{p = Prime@ n}, SelectFirst[Reverse@ Range@ 10, Mod[(p - 1)!, #] == # - 1 &[p^#] &]], {n, 105}] (* _Michael De Vlieger_, Aug 20 2017 *)
%o A283149 (PARI) a(n) = my(p=prime(n), k=1); while(Mod((p-1)!, p^k)==-1, k++); k-1
%Y A283149 Cf. A002068, A007540.
%K A283149 nonn
%O A283149 1,3
%A A283149 _Felix Fröhlich_, Mar 01 2017
%E A283149 More terms from _Antti Karttunen_, Aug 20 2017