login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = n + (n - 1) * (n - pi(n)).
1

%I #5 Oct 17 2021 21:17:56

%S 1,3,5,10,13,21,25,36,49,64,71,89,97,118,141,166,177,205,217,248,281,

%T 316,331,369,409,451,495,541,561,610,631,683,737,793,851,911,937,1000,

%U 1065,1132,1161,1231,1261,1334,1409,1486,1519,1599,1681,1765,1851,1939,1977,2068

%N a(n) = n + (n - 1) * (n - pi(n)).

%C For all 1 <= k <= n, add 1 if k is prime, otherwise add n. For example, when n = 7, there are 4 numbers less than or equal to 7 that are prime and 3 that are not. Then a(7) = 1*4 + 7*3 = 25.

%F a(n) = Sum_{k=1..n} n^c(n), where c(n) is the characteristic function of nonprimes (A005171).

%t Table[n + (n - 1)*(n - PrimePi[n]), {n, 50}]

%Y Cf. A000720 (pi), A005171, A345888.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Jun 28 2021