The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A238532 Number of distinct factorial numbers congruent to -1 (mod n). 2
 0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,7 COMMENTS Number of solutions to k! == -1 (mod n), k>=1. Counts the frequency of the value n-1 in the n-th row of triangle A062169. Values 1..9 occur for the first time at n = 2, 7, 23, 59, 227, 401, 71, 3643, 62939, which are all prime numbers (see also A230315). Sequence A256519 gives composite k for which a(k) > 0. - Antti Karttunen, May 24 2021 LINKS Antti Karttunen, Table of n, a(n) for n = 1..65537 EXAMPLE There are two 6's in the 7th row of A062169. Therefore a(7)=2. MAPLE A238532 := proc(n)     local a, k ;     a := 0 ;     for k from 1 to n-1 do         if modp(k!, n) = modp(-1, n) then             a := a+1 ;         end if;     end do:     a ; end proc: # R. J. Mathar, Apr 02 2014 PROG (PARI) A238532(n) = { my(m=1, s=0); for(k=1, oo, m *= k; if(!(m%n), return(s), if(1+(m%n)==n, s++))); }; \\ Antti Karttunen, May 24 2021 (PARI) A238532(n) = { my(m=Mod(1, n), s=0, x); for(k=1, oo, m *= Mod(k, n); x = lift(m); if(!x, return(s), if(x==(n-1), s++))); }; \\ (Much faster than above program) - Antti Karttunen, May 24 2021 CROSSREFS Cf. A000142, A049046, A062169, A230315, A256519. Sequence in context: A292261 A035153 A069847 * A097249 A112313 A297115 Adjacent sequences:  A238529 A238530 A238531 * A238533 A238534 A238535 KEYWORD nonn AUTHOR R. J. Mathar, Apr 02 2014 STATUS approved

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

Last modified December 6 16:06 EST 2021. Contains 349565 sequences. (Running on oeis4.)