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.

A049046 Number of k >= 1 with k! == 1 (mod n).

This page as a plain text file.
%I A049046 #34 Jun 26 2019 12:32:28
%S A049046 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,
%T A049046 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,
%U A049046 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
%N A049046 Number of k >= 1 with k! == 1 (mod n).
%C A049046 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
%H A049046 Antti Karttunen, <a href="/A049046/b049046.txt">Table of n, a(n) for n = 1..12021</a>
%e A049046 From _Antti Karttunen_, Oct 01 2018: (Start)
%e A049046 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.
%e A049046 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.
%e A049046 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.
%e A049046 (End)
%t A049046 Table[Length[Select[Range[100], Mod[#!, n] == 1 &]], {n, 1, 100}] (* _G. C. Greubel_, Oct 08 2018 *)
%o A049046 (PARI) A049046(n) = { my(s=0, r, k=1); while((r=(k! % n))>0, s += (1==r); k++); (s); }; \\ _Antti Karttunen_, Oct 01 2018
%Y A049046 Cf. A000142, A002034, A071710, A038203, A049050.
%K A049046 nonn
%O A049046 1,5
%A A049046 _David W. Wilson_
%E A049046 Term a(1) corrected and the definition clarified by _Antti Karttunen_, Oct 01 2018
%E A049046 Definition further edited by _Antti Karttunen_, Oct 06 2018, based on feedback from _David W. Wilson_