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!)
A334122 a(n) is the sum of all primes <= n, mod n. 1
0, 0, 2, 1, 0, 4, 3, 1, 8, 7, 6, 4, 2, 13, 11, 9, 7, 4, 1, 17, 14, 11, 8, 4, 0, 22, 19, 16, 13, 9, 5, 0, 28, 24, 20, 16, 12, 7, 2, 37, 33, 28, 23, 17, 11, 5, 46, 40, 34, 28, 22, 16, 10, 3, 51, 45, 39, 33, 27, 20, 13, 5, 60, 53, 46, 39, 32, 24, 16, 8, 0, 63, 55 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = A034387(n) mod n.
EXAMPLE
a(7) = (2+3+5+7) mod 7 = 17 mod 7 = 3.
MAPLE
b:= proc(n) b(n):= `if`(n<2, 0, b(n-1)+`if`(isprime(n), n, 0)) end:
a:= n-> irem(b(n), n):
seq(a(n), n=1..80); # Alois P. Heinz, Apr 15 2020
MATHEMATICA
Mod[Accumulate[(# * Boole @ PrimeQ[#]) & /@ (r = Range[100])], r] (* Amiram Eldar, Apr 15 2020 *)
PROG
(Python) return (sum(i for i in range(n+1) if is_prime(i)) % n)
(PARI) a(n) = my(np=primepi(n)); vecsum(primes(np)) % n; \\ Michel Marcus, Apr 16 2020
CROSSREFS
Sequence in context: A131667 A322080 A361958 * A086802 A092488 A068527
KEYWORD
nonn,easy,look
AUTHOR
Christoph Schreier, Apr 15 2020
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 March 29 05:16 EDT 2024. Contains 371264 sequences. (Running on oeis4.)