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.

Showing 1-3 of 3 results.

A185382 Sum_{j=1..n-1} P(n)-P(j), where P(j) = A065091(j) is the j-th odd prime.

Original entry on oeis.org

0, 2, 6, 18, 26, 46, 58, 86, 134, 152, 212, 256, 280, 332, 416, 506, 538, 640, 712, 750, 870, 954, 1086, 1270, 1366, 1416, 1520, 1574, 1686, 2092, 2212, 2398, 2462, 2792, 2860, 3070, 3286, 3434, 3662, 3896, 3976, 4386, 4470, 4642, 4730, 5270
Offset: 1

Views

Author

Clark Kimberling, Feb 13 2012

Keywords

Comments

It appears 1/3 of a(n) values are divisible by 3 (as measured up to n = 8000). Almost all of these cases occur consecutively (i.e., in "runs"). The sizes of these runs, including runs of 1, in the first 250 primes are given by this sequence: {2, 4, 1, 1, 2, 4, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 5, 6, 3, 2, 2, 3, 3, 9, 1, ..} with two runs up to 12 in length occurring in the first 5000 primes. - Richard R. Forberg, Mar 26 2015
a(n+1) == a(n) (mod 3) iff n == 0 (mod 3) or P(n+1) == P(n) (mod 3); this should have asymptotic probability 2/3, and explains some of the above comment. - Robert Israel, Mar 26 2015

Examples

			a(4)=(11-3)+(11-5)+(11-7)=18.
		

Crossrefs

Cf. A001223, A152535, A206802 (a(n)/2), A206803 (= partial sums of this), A206804, A206817.

Programs

  • Maple
    N:= 1000: # to get terms for all odd primes <= N
    P:= select(isprime,[seq(2*i+1, i=1..floor((N-1)/2))]):
    Q:= ListTools[PartialSums](P):
    seq(n*P[n]-Q[n],n=2..nops(P)); # Robert Israel, Mar 26 2015
  • Mathematica
    s[k_] := Prime[k + 1]; p[n_] := Sum[s[k], {k, 1, n}]; c[n_] := n*s[n] - p[n]; Table[c[n], {n, 2, 100}]
  • PARI
    A185382(n)=(n-1)*prime(n+1)-sum(k=2,n-1,prime(k)) \\ M. F. Hasler, May 02 2015

Formula

a(n) = (n-1)*A065091(n) - A071148(n-1) = (n-1)*prime(n+1) - sum_{1 < k <= n} prime(k). [Corrected and extended by M. F. Hasler, May 02 2015]
a(n) = A206803(n) - A206803(n-1).
a(n) = Sum_{j=1..n-1} j*A001223(j+1). - Robert Israel, Mar 26 2015

Extensions

Edited and a(1)=0 prefixed by M. F. Hasler, May 02 2015

A206803 Sum_{0A065091(j) is the j-th odd prime.

Original entry on oeis.org

2, 8, 26, 52, 98, 156, 242, 376, 528, 740, 996, 1276, 1608, 2024, 2530, 3068, 3708, 4420, 5170, 6040, 6994, 8080, 9350, 10716, 12132, 13652, 15226, 16912, 19004, 21216, 23614, 26076, 28868, 31728, 34798, 38084, 41518, 45180, 49076
Offset: 2

Views

Author

Clark Kimberling, Feb 13 2012

Keywords

Comments

Partial sums of A185382.

Crossrefs

Programs

  • Mathematica
    s[k_] := Prime[k + 1]; t[1] = 0;
    p[n_] := Sum[s[k], {k, 1, n}];
    c[n_] := n*s[n] - p[n]
    t[n_] := t[n - 1] + (n - 1) s[n] - p[n - 1]
    Table[c[n], {n, 2, 100}]  (* A185382 *)
    %/2  (* A206802 *)
    Flatten[Table[t[n], {n, 2, 40}]]  (*  A206803 *)
    %/2  (* A206804 *)
  • Sage
    [sum([sum([nth_prime(k+1)-nth_prime(j+1) for j in range(1,k)]) for k in range(2,n+1)]) for n in range(2,41)] # Danny Rorabaugh, Apr 18 2015

A206802 a(n) = (1/2)*A185382(n).

Original entry on oeis.org

1, 3, 9, 13, 23, 29, 43, 67, 76, 106, 128, 140, 166, 208, 253, 269, 320, 356, 375, 435, 477, 543, 635, 683, 708, 760, 787, 843, 1046, 1106, 1199, 1231, 1396, 1430, 1535, 1643, 1717, 1831, 1948, 1988, 2193, 2235, 2321, 2365, 2635, 2911, 3005
Offset: 2

Views

Author

Clark Kimberling, Feb 13 2012

Keywords

Comments

See A185382.

Crossrefs

Cf. A185382.

Programs

  • Mathematica
    s[k_] := Prime[k + 1]; t[1] = 0;
    p[n_] := Sum[s[k], {k, 1, n}];
    c[n_] := n*s[n] - p[n]
    t[n_] := t[n - 1] + (n - 1) s[n] - p[n - 1]
    Table[c[n], {n, 2, 100}]  (* A185382 *)
    %/2  (* A206802 *)
    Flatten[Table[t[n], {n, 2, 40}]]  (*  A206803 *)
    %/2  (* A206804 *)
    Table[Sum[Prime[n + 1] - Prime[j + 1], {j, n - 1}]/2, {n, 2, 48}] (* Michael De Vlieger, Sep 13 2016 *)
Showing 1-3 of 3 results.