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.

Previous Showing 51-54 of 54 results.

A301707 a(n) = n * Sum_{k prime<=n} k.

Original entry on oeis.org

0, 4, 15, 20, 50, 60, 119, 136, 153, 170, 308, 336, 533, 574, 615, 656, 986, 1044, 1463, 1540, 1617, 1694, 2300, 2400, 2500, 2600, 2700, 2800, 3741, 3870, 4960, 5120, 5280, 5440, 5600, 5760, 7289, 7486, 7683, 7880, 9758, 9996, 12083, 12364, 12645, 12926, 15416, 15744
Offset: 1

Views

Author

Pedro Caceres, Mar 25 2018

Keywords

Examples

			a(6) = 6 * Sum_{k primes<=6} = 6 * (2+3+5) = 6 * 10 = 60.
		

Crossrefs

Cf. A034387.

Programs

  • Mathematica
    Array[# Sum[Prime@ i, {i, PrimePi@ #}] &, 48] (* Michael De Vlieger, Apr 10 2018 *)
  • PARI
    a(n) = n*sum(k=1, n, k*isprime(k)); \\ Michel Marcus, Mar 26 2018

Formula

a(n) = n * A034387(n).

Extensions

More terms from Michel Marcus, Apr 09 2018

A333700 a(n) = Sum_{k=1..n} pi(k) * pi(n-k).

Original entry on oeis.org

0, 0, 0, 1, 4, 8, 14, 22, 32, 45, 58, 73, 90, 110, 132, 158, 184, 214, 246, 282, 320, 363, 406, 455, 506, 562, 618, 678, 738, 804, 872, 944, 1018, 1099, 1180, 1269, 1358, 1450, 1544, 1644, 1744, 1852, 1962, 2078, 2196, 2321, 2446, 2581, 2718, 2863
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 02 2020

Keywords

Comments

Convolution of A000720 with itself.

Crossrefs

Programs

  • Mathematica
    Table[Sum[PrimePi[k] PrimePi[n - k], {k, n}], {n, 50}]
    nmax = 50; CoefficientList[Series[(1/(1 - x)^2) Sum[x^Prime[k], {k, 1, nmax}]^2, {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, primepi(k)*primepi(n-k)); \\ Michel Marcus, Apr 03 2020

Formula

G.f.: (1/(1 - x)^2) * (Sum_{k>=1} x^prime(k))^2.
a(n) = Sum_{k=1..n} A046992(k) * A010051(n-k).
a(n) = Sum_{k=1..n} k * A073610(n-k+1).
From Jianing Song, Sep 27 2023: (Start)
a(n-1) = Integral_{0..n} pi(x) * pi(n-x) dx, since Integral_{0..n} pi(x) * pi(n-x) dx = Sum_{k=1..n} Integral_{k-1..k} pi(x) * pi(n-x) dx = Sum_{k=1..n} pi(k-1) * pi(n-k) = Sum_{k=0..n-1} pi(k) * pi(n-1-k) = a(n-1).
a(n) = (a(n-1) + a(n+1))/2 for n == 4 (mod 6) with n > 4, as shown in the Mathematics Stack Exchange link. (End)

A351827 Sum of the numbers <= n that are either prime, a divisor of n, or both.

Original entry on oeis.org

1, 3, 6, 10, 11, 17, 18, 30, 27, 28, 29, 51, 42, 56, 57, 70, 59, 92, 78, 112, 99, 100, 101, 155, 126, 127, 137, 147, 130, 191, 161, 221, 194, 195, 196, 246, 198, 236, 237, 280, 239, 322, 282, 352, 351, 328, 329, 447, 378, 414, 380, 411, 382, 496, 437, 492, 439, 440, 441, 598
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 20 2022

Keywords

Crossrefs

Cf. A000203 (sigma), A008472 (sopf), A010051, A034387, A351519.

Formula

a(n) = Sum_{k=1..n} k * (u(k) + v(n/k) - u(k)*v(n/k)), where u(n) is the prime characteristic (A010051) and v(n) = 1 - ceiling(n) + floor(n).
a(n) = sigma(n) - sopf(n) + Sum_{p<=n, p prime} p. - Wesley Ivan Hurt, Dec 31 2023

A351914 Numbers m such that the average of the prime numbers up to m is greater than or equal to m/2.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 11, 13, 19
Offset: 1

Views

Author

Masahiko Shin, Feb 25 2022

Keywords

Comments

The average of the prime numbers up to m is asymptotically equal to m/2 by the prime number theorem. It is shown by Mandl's inequality that m/2 is strictly greater than the average if m > 19 and thus the sequence is complete.

Examples

			5 is a term since the average of the primes up to 5 is (2 + 3 + 5)/3 = 10/3, which is greater than 5/2.
8 is a term since the average of the primes up to 8 is (2 + 3 + 5 + 7)/4 = 17/4 = 4.25, which is greater than 8/2 = 4.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n=0, 0, `if`(isprime(n), n, 0)+s(n-1)) end:
    q:= n-> is(2*s(n)/numtheory[pi](n)>=n):
    select(q, [$2..20])[];  # Alois P. Heinz, Feb 25 2022
  • Mathematica
    s[n_] := s[n] = If[n == 0, 0, If[PrimeQ[n], n, 0] + s[n-1]];
    Select[Range[2, 20], 2 s[#]/PrimePi[#] > #&] (* Jean-François Alcover, Dec 26 2022, after Alois P. Heinz *)
  • Python
    from sympy import primerange
    def average_of_primes_up_to(i):
        primes_up_to_i =  list(primerange(2, i+1))
        return sum(primes_up_to_i) / len(primes_up_to_i)
    def a_list():
        return [i for i in range(2, 20) if average_of_primes_up_to(i) >= i / 2]

Formula

2*A034387(a(n))/A000720(a(n)) >= a(n).
Previous Showing 51-54 of 54 results.