%I #19 Feb 11 2024 11:44:29
%S 2,11,29,787,15773
%N Numbers k such that A003418(k-1) = lcm(1,2,...,k-1) is congruent to 1 modulo k.
%C Numbers k such that A158851(k-1) = 1.
%C k must be prime.
%C No further terms below 3.8*10^8. - _Max Alekseyev_, Jun 19 2011
%e For the first nontrivial example: lcm(1,2,3,4,5,6,7,8,9,10) = 2520 and 2520 mod 11 = 1, so 11 is in the sequence.
%t fQ[n_] := Mod[ LCM @@ Range[n - 1], n] == 1; k = 2; lst = {}; While[k < 10^6, If[ fQ@k, Print@k; AppendTo[lst, k]]; k++ ]; lst (* _Robert G. Wilson v_, Jun 02 2010 *)
%o (PARI) { L=1; for(n=2,10^8, if( ispseudoprime(n), if(L%n==1,print(n)); L*=n); if( ispower(n,,&p) && ispseudoprime(p), L*=p ); ) } \\ _Max Alekseyev_, Jun 19 2011
%Y Cf. A158851.
%K nonn,more
%O 1,1
%A _Nick Hobson_, May 31 2010
%E Offset changed to 1 by _Jinyuan Wang_, May 02 2020
|