cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A349214 a(n) = Sum_{k=1..n} k^c(k), where c is the prime characteristic (A010051).

This page as a plain text file.
%I A349214 #19 Nov 24 2021 08:47:26
%S A349214 1,3,6,7,12,13,20,21,22,23,34,35,48,49,50,51,68,69,88,89,90,91,114,
%T A349214 115,116,117,118,119,148,149,180,181,182,183,184,185,222,223,224,225,
%U A349214 266,267,310,311,312,313,360,361,362,363,364,365,418,419,420,421,422,423,482,483,544
%N A349214 a(n) = Sum_{k=1..n} k^c(k), where c is the prime characteristic (A010051).
%C A349214 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.
%H A349214 Antti Karttunen, <a href="/A349214/b349214.txt">Table of n, a(n) for n = 1..10000</a>
%F A349214 a(n) = A034387(n) + A062298(n). - _Wesley Ivan Hurt_, Nov 23 2021
%t A349214 a[n_] := Sum[k^Boole[PrimeQ[k]], {k, 1, n}]; Array[a, 60] (* _Amiram Eldar_, Nov 11 2021 *)
%o A349214 (PARI) a(n) = sum(k=1, n, if (isprime(k), k, 1)); \\ _Michel Marcus_, Nov 11 2021
%o A349214 (Python)
%o A349214 from sympy import primerange
%o A349214 def A349214(n):
%o A349214     p = list(primerange(2,n+1))
%o A349214     return n-len(p)+sum(p) # _Chai Wah Wu_, Nov 11 2021
%Y A349214 Partial sums of A089026.
%Y A349214 Cf. A010051, A034387, A062298.
%K A349214 nonn
%O A349214 1,2
%A A349214 _Wesley Ivan Hurt_, Nov 10 2021