The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A349214 a(n) = Sum_{k=1..n} k^c(k), where c is the prime characteristic (A010051). 1
1, 3, 6, 7, 12, 13, 20, 21, 22, 23, 34, 35, 48, 49, 50, 51, 68, 69, 88, 89, 90, 91, 114, 115, 116, 117, 118, 119, 148, 149, 180, 181, 182, 183, 184, 185, 222, 223, 224, 225, 266, 267, 310, 311, 312, 313, 360, 361, 362, 363, 364, 365, 418, 419, 420, 421, 422, 423, 482, 483, 544 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For k in 1 <= k <= n, add k if k is prime, otherwise add 1. For example a(6) = 1 + 2 + 3 + 1 + 5 + 1 = 13.
LINKS
FORMULA
a(n) = A034387(n) + A062298(n). - Wesley Ivan Hurt, Nov 23 2021
MATHEMATICA
a[n_] := Sum[k^Boole[PrimeQ[k]], {k, 1, n}]; Array[a, 60] (* Amiram Eldar, Nov 11 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, if (isprime(k), k, 1)); \\ Michel Marcus, Nov 11 2021
(Python)
from sympy import primerange
def A349214(n):
p = list(primerange(2, n+1))
return n-len(p)+sum(p) # Chai Wah Wu, Nov 11 2021
CROSSREFS
Partial sums of A089026.
Sequence in context: A032849 A038591 A333794 * A182181 A138038 A095029
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 10 2021
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 16 20:34 EDT 2024. Contains 372555 sequences. (Running on oeis4.)