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 11-14 of 14 results.

A243593 Primes giving record values of f(n) = (2*Sum_{i=1..n}(i*prime(i)) / Sum_{i=1..n}(prime(i))-(n+1))/(n-1).

Original entry on oeis.org

5, 7, 11, 13, 17, 23, 29, 37, 41, 53, 59, 97, 101, 127, 131, 137, 149, 223, 227, 307, 331, 337, 347, 349, 419, 541, 547, 557, 563, 569, 587, 809, 821, 967, 1277, 1361, 1367, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1847, 1861, 1867, 1871, 1949, 1973
Offset: 1

Views

Author

Esko Ranta, Jun 07 2014

Keywords

Comments

Is the sequence finite? It would mean that the value of f(n) would become monotonic after inclusion of the largest prime in the sequence.
It should be easy to prove that the value of lim 3*f(n) is 1 when n approaches infinity.
The generalized formula 3*(2*sum_XY/sum_Y - (n+1))/(n-1) is a non-linear correlation coefficient between the X (1,2,3...) and the nonnegative Y values, with range from -3 to +3, and linear correlation still giving value 1 or -1.
What is the next term after 32057?

Examples

			3rd prime is 5, and f(3) > f(2) so 5 is included in the sequence.
Starting at n=2, the values of f(n) are: 1/5, 3/10, 1/3, 11/28, 81/205, 71/174, 31/77, 81/200, 485/1161, ...
		

Crossrefs

Programs

  • PARI
    f(n) = (2*sum(i=1,n,i*prime(i))/sum(i=1, n, prime(i)) - (n+1))/(n-1);
    lista(nn) = {last = f(2); for (i=3, nn, new = f(i); if (new > last, print1(prime(i), ", ");); new = last;);} \\ Michel Marcus, Jun 10 2014

A307716 Denominator of the barycenter of first n primes defined as a(n) = denominator(Sum_{i=1..n} (i*prime(i)) / Sum_{i=1..n} prime(i)).

Original entry on oeis.org

1, 5, 10, 1, 14, 41, 58, 11, 50, 129, 160, 197, 119, 281, 328, 127, 110, 501, 568, 213, 89, 791, 874, 963, 53, 27, 1264, 457, 370, 1593, 1720, 1851, 71, 2127, 2276, 809, 1292, 2747, 2914, 3087, 1633, 1149, 34, 3831, 1007, 4227, 4438, 4661
Offset: 1

Views

Author

Andres Cicuttin, Apr 25 2019

Keywords

Comments

It appears that lim_{n->infinity} (1/n)*(A014285(n)/A007504(n)) = k, where k is a constant around 2/3.
a(n) = A007504(n) if and only if n is in A307414. - Robert Israel, Jul 08 2019

Crossrefs

Cf. A306834 (numerators), A272206, A007504, A014285, A307414.

Programs

  • Maple
    S1:= 0:S2:= 0:
    for n from 1 to 100 do
      p:= ithprime(n);
      S1:= S1 + p;
      S2:= S2 + n*p;
      A[n]:= denom(S2/S1)
    od:
    seq(A[i],i=1..100); # Robert Israel, Jul 08 2019
  • Mathematica
    a[n_]:=Sum[i*Prime[i], {i, 1, n}]/Sum[Prime[i], {i, 1, n}];
    Table[a[n]//Denominator, {n, 1, 48}]
  • PARI
    a(n) = my(vp=primes(n)); denominator(sum(i=1, n, i*vp[i])/sum(i=1, n, vp[i])) \\ Michel Marcus, Apr 25 2019

Formula

a(n) = denominator(Sum_{i=1..n} (i*prime(i)) / Sum_{i=1..n} prime(i)).
a(n) = denominator(A014285(n)/A007504(n)).

A330087 Permanent of a square matrix M(n) whose general element M_{i,j} is defined by i*prime(j).

Original entry on oeis.org

1, 2, 24, 1080, 120960, 33264000, 15567552000, 12967770816000, 15768809312256000, 29377291748732928000, 85194146071325491200000, 319563241913541917491200000, 1702632952915351336393113600000, 11797543730750469409867884134400000, 99429698562764956186366527484723200000
Offset: 0

Views

Author

Stefano Spezia, Dec 01 2019

Keywords

Comments

det(M(0)) = 1, det(M(1)) = 2 and det(M(n)) = 0 for n > 1.
The trace of the matrix M(n) is A014285(n).
The antitrace of the matrix M(n) is A014148(n).
The antidiagonal of the matrix M(n) is the n-th row of the triangle A309131.

Examples

			For n = 1 the matrix M(1) is
  2
with permanent a(1) = 2.
For n = 2 the matrix M(2) is
  2, 3
  4, 6
with permanent a(2) = 24.
For n = 3 the matrix M(3) is
  2,  3,  5
  4,  6, 10
  6,  9, 15
with permanent a(3) = 1080.
		

Crossrefs

Programs

  • Maple
    with(LinearAlgebra):
    a:= n-> `if`(n=0, 1, Permanent(Matrix(n, (i, j)-> i*ithprime(j)))):
    seq(a(n), n=0..14);  # Alois P. Heinz, Dec 04 2019
  • Mathematica
    M[i_, j_, n_] := i*Prime[j]; a[n_] := If[n==0,1,Permanent[Table[M[i, j, n], {i, n}, {j, n}]]]; Array[a, 14, 0]
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, i*prime(j))); \\ Michel Marcus, Dec 04 2019

Extensions

a(0) = 1 prepended by Michel Marcus, Dec 04 2019

A356178 Numbers k such that both Sum_{i=1..k} i*prime(i) and Sum_{i=1..k} (k+1-i)*prime(i) are prime.

Original entry on oeis.org

1, 3, 199, 351, 1583, 1955, 2579, 2627, 3251, 3407, 3503, 5311, 6359, 6819, 7295, 7547, 8791, 9663, 10143, 10591, 11499, 11579, 12199, 12443, 14527, 15563, 15583, 16051, 16543, 16655, 18047, 18319, 20691, 20847, 23979, 24079, 24575, 25667, 26491, 28235, 30395, 30627, 32235, 32259, 33091, 33287, 33527
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 28 2022

Keywords

Comments

Numbers k such that A014148(k) and A014285(k) are both prime.
a(n) == 3 (mod 4) for n > 1.

Examples

			a(2) = 3 is a term because Sum_{i=1..3} i*prime(i) = 1*2 + 2*3 + 3*5 = 23 and Sum_{i=1..3} (4-i)*prime(i) = 3*2 + 2*3 + 1*5 = 17 are prime.
		

Crossrefs

Programs

  • Maple
    S1:= 2: S2:= 2: S3:= 2*S2-S1: R:= 1: count:= 1: p:= 2:
    for n from 2 to 40000 do
      p:= nextprime(p);
      S1:= S1 + n*p;
      S2:= S2 + p;
      if n mod 4 = 3 and isprime(S1) then
        S3:= (n+1)*S2 - S1;
        if isprime(S3) then
           count:= count+1; R:= R, n;
        fi
      fi;
    od:
    R;
  • Mathematica
    r = Range[35000]; p = Prime[r]; Intersection[Position[Accumulate[r*p], ?PrimeQ], Position[Accumulate[Accumulate[p]], ?PrimeQ]] // Flatten (* Amiram Eldar, Jul 28 2022 *)
  • PARI
    isok(k) = my(vp=primes(k)); isprime(sum(i=1, k, i*vp[i])) && isprime(sum(i=1, k, (k+1-i)*vp[i])); \\ Michel Marcus, Jul 29 2022
Previous Showing 11-14 of 14 results.