login
A087611
a(n) = (prime(n) - 1) mod n.
2
0, 0, 1, 2, 0, 0, 2, 2, 4, 8, 8, 0, 1, 0, 1, 4, 7, 6, 9, 10, 9, 12, 13, 16, 21, 22, 21, 22, 21, 22, 2, 2, 4, 2, 8, 6, 8, 10, 10, 12, 14, 12, 18, 16, 16, 14, 22, 30, 30, 28, 28, 30, 28, 34, 36, 38, 40, 38, 40, 40, 38, 44, 54, 54, 52, 52, 62, 64, 1, 68, 68, 70, 1, 2, 3, 2, 3, 6, 5, 8
OFFSET
1,4
PROG
(Magma) [((NthPrime(n) -1) mod n): n in [1..100]]; // Vincenzo Librandi, Apr 06 2011
(PARI) a(n) = (prime(n)-1) % n; \\ Kevin Ryde, Feb 03 2023
CROSSREFS
Cf. A023143 (indices of 0's).
Sequence in context: A033718 A033737 A033747 * A282133 A338819 A153869
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Sep 11 2003
STATUS
approved