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!)
A061008 a(n) = Sum_{j=1..n} (-(n-1)! mod n). 4
0, 1, 2, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 23, 23, 23 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = a(n-1) + A061007(n) = A061009(n) + 2. For n > 3, a(n) = pi(n) + 2 where pi(n) = A000720(n) is the number of primes less than or equal to n.
EXAMPLE
a(6) = 5 since (-1 mod 1) + (-1 mod 2) + (-2 mod 3) + (-6 mod 4) + (-24 mod 5) + (-120 mod 6) = 0 + 1 + 1 + 2 + 1 + 0 = 5.
MATHEMATICA
Join[{0, 1, 2}, a[n_]:= 2 + PrimePi[n]; Table[a[n], {n, 4, 100}]] (* Vincenzo Librandi, Aug 11 2017 *)
PROG
(Magma) [0, 1, 2] cat [ 2+#PrimesUpTo(n): n in [4..200] ]; // Vincenzo Librandi, Aug 11 2017
CROSSREFS
Sequence in context: A227401 A131813 A083038 * A256720 A091988 A023824
KEYWORD
nonn
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 May 10 06:43 EDT 2024. Contains 372358 sequences. (Running on oeis4.)