login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A049046 Number of k >= 1 with k! == 1 (mod n). 5
0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 4, 1, 2, 1, 1, 1, 5, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 4, 1, 5, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 3, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
The first occurrences for 0..10 are 1, 2, 5, 29, 17, 23, 199, 619, 3313, 4093, 3011, ... (see A049050). - Antti Karttunen, Oct 01 2018
LINKS
EXAMPLE
From Antti Karttunen, Oct 01 2018: (Start)
a(1) = 0 because 1 divides all factorial numbers (A000142): 1, 2, 6, 24, ... and thus there are no cases where the remainder would be 1.
a(3) = 1 as (1! mod 3) = 1, (2! mod 3) = 2 and for 3! and larger factorials the remainder is always 0. Thus there is exactly one case where the remainder is one.
a(5) = 2 as (1! mod 5) = 1, (2! mod 5) = 2, (3! mod 5) = 1, (4! mod 5) = 5, (5! mod 5) = 0, and so on ever after for larger factorials.
(End)
MATHEMATICA
Table[Length[Select[Range[100], Mod[#!, n] == 1 &]], {n, 1, 100}] (* G. C. Greubel, Oct 08 2018 *)
PROG
(PARI) A049046(n) = { my(s=0, r, k=1); while((r=(k! % n))>0, s += (1==r); k++); (s); }; \\ Antti Karttunen, Oct 01 2018
CROSSREFS
Sequence in context: A131017 A244227 A214713 * A227945 A003647 A353352
KEYWORD
nonn
AUTHOR
EXTENSIONS
Term a(1) corrected and the definition clarified by Antti Karttunen, Oct 01 2018
Definition further edited by Antti Karttunen, Oct 06 2018, based on feedback from David W. Wilson
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 14:15 EDT 2024. Contains 371914 sequences. (Running on oeis4.)