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!)
A061007 a(n) = -(n-1)! mod n. 9
0, 1, 1, 2, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
The following sequences all appear to have the same parity (with an extra zero term at the start of A010051): A010051, A061007, A035026, A069754, A071574. - Jeremy Gardiner, Aug 09 2002
LINKS
FORMULA
a(4) = 2, a(p) = 1 for p prime, a(n) = 0 otherwise. Apart from n = 4, a(n) = A010051(n) = A061006(n)/(n-1).
EXAMPLE
a(4) = 2 since -(4 - 1)! = -6 = 2 mod 4.
a(5) = 1 since -(5 - 1)! = -24 = 1 mod 5.
a(6) = 0 since -(6 - 1)! = -120 = 0 mod 6.
MATHEMATICA
Table[Mod[-(n - 1)!, n], {n, 100}] (* Alonso del Arte, Mar 20 2014 *)
PROG
(PARI) A061007(n) = ((-((n-1)!))%n); \\ Antti Karttunen, Aug 27 2017
(Python)
from sympy import isprime
def A061007(n): return 2 if n == 4 else int(isprime(n)) # Chai Wah Wu, Mar 22 2023
CROSSREFS
Positive for all but the first term of A046022.
Sequence in context: A269245 A321886 A060154 * A060838 A206567 A362422
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Apr 12 2001
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 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)