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!)
A067462 a(n) = (1! + 2! + ... + (n-1)!) mod n. 3

%I #22 Jan 23 2023 15:04:16

%S 0,1,0,1,3,3,5,1,0,3,0,9,9,5,3,9,12,9,8,13,12,11,20,9,13,9,9,5,16,3,1,

%T 25,0,29,33,9,4,27,9,33,3,33,15,33,18,43,17,9,47,13,12,9,12,9,33,33,

%U 27,45,27,33,21,1,54,25,48,33,64,29,66,33,67,9,54,41,63,65,33,9,19,73,63

%N a(n) = (1! + 2! + ... + (n-1)!) mod n.

%H A.H.M. Smeets, <a href="/A067462/b067462.txt">Table of n, a(n) for n = 1..20000</a> (first 1000 terms from T. D. Noe)

%t Mod[ #[[1]], #[[2]]]&/@Transpose[{Rest[FoldList[Plus, 0, Factorial[Range[90]]]], Range[90]}]

%t Table[Mod[Total[Range[n-1]!],n],{n,90}] (* _Harvey P. Dale_, Jan 23 2023 *)

%o (PARI) a(n) = my(s=0, p=1); for (i=1, n-1, f = Mod(i, n); p*=f; s += p); lift(s); \\ _Michel Marcus_, Aug 19 2019

%o (Python)

%o n = 0

%o while n < 200:

%o n,f,fs,i = n+1,1,0,1

%o while i < n:

%o f,i = (f*i)%n,i+1

%o fs = (fs+f)%n

%o print(n,fs) # _A.H.M. Smeets_, Aug 19 2019

%Y Cf. A049782.

%K easy,nonn

%O 1,5

%A _Alex Fink_, Feb 24 2002

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 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)