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-6 of 6 results.

A077126 Sum of even-indexed primes.

Original entry on oeis.org

3, 10, 23, 42, 71, 108, 151, 204, 265, 336, 415, 504, 605, 712, 825, 956, 1095, 1246, 1409, 1582, 1763, 1956, 2155, 2378, 2607, 2846, 3097, 3360, 3631, 3912, 4205, 4516, 4833, 5170, 5519, 5878, 6251, 6634, 7031, 7440, 7861, 8294, 8737, 9194, 9657, 10136, 10627
Offset: 1

Views

Author

Jon Perry, Nov 29 2002

Keywords

Comments

Partial sums of A031215. - Michel Marcus, Oct 27 2015

Examples

			p_1=2, p_2=3, p_3=5 and p_4=7, therefore a(2) = p_2 + p_4 = 3 + 7 = 10.
		

Crossrefs

Programs

  • Mathematica
    A077126list[nmax_]:=Accumulate[Prime[Range[2,2nmax,2]]];A077126list[100] (* Paolo Xausa, Aug 28 2023 *)
  • PARI
    pc=1; ps=0; forprime (p=2,500,pc=3-pc; if (pc==1,ps=ps+p; print1(ps",")))

A077133 a(n) is the difference between the sum of the first n even-indexed primes and the sum of the first n odd-indexed primes.

Original entry on oeis.org

1, 3, 5, 7, 13, 19, 21, 27, 29, 33, 39, 45, 49, 53, 57, 61, 63, 65, 71, 77, 79, 81, 83, 95, 97, 103, 113, 119, 121, 125, 135, 139, 143, 149, 151, 157, 163, 167, 175, 183, 185, 187, 191, 199, 201, 213, 217, 221, 233, 251, 261, 267, 273, 279, 281, 287, 289, 299
Offset: 1

Views

Author

Jon Perry, Nov 29 2002

Keywords

Comments

Some odd numbers such as 11, 17, 23 and 25 never appear.

Examples

			a(2) = 3 as the sum of the first 2 even-indexed primes is prime(2) + prime(4) = 3 + 7 = 10, the sum of the first 2 odd-indexed primes is prime(1) + prime(3) = 2 + 5 = 7 and 10 - 7 = 3. [edited by _Paolo Xausa_, Apr 12 2023]
		

Crossrefs

Programs

  • Maple
    with(numtheory): A008347 := proc(n) option remember; if n = 0 then 0 else abs(A008347(n-1)-ithprime(n)); fi; end proc:
    seq(A008347(2n),n=1..80); # Ridouane Oudra, Aug 31 2019
  • Mathematica
    Table[ Sum[ Prime[2i], {i, 1, n}] - Sum[ Prime[2i - 1], {i, 1, n}], {n, 1, 60}]
    A077133[nmax_]:=Accumulate[Prime[Range[2,2nmax,2]]-Prime[Range[1,2nmax,2]]];A077133[100] (* Paolo Xausa, Apr 12 2023 *)
  • PARI
    my(pc=1, p1s=0, p2s=0); forprime (p=2, 500, pc=!pc; if (pc, p1s+=p, p2s+=p); if (pc,print1(p1s-p2s, ", ")))

Formula

a(n) = Sum_{i=0..n-1} (prime(2*i+2) - prime(2*i+1)).
a(n) = A008347(2n). - Ridouane Oudra, Aug 31 2019
a(n) = A077126(n) - A077131(n). - Michel Marcus, Oct 05 2019

Extensions

Edited and extended by Robert G. Wilson v, Nov 30 2002
Name clarified by Paolo Xausa, Apr 12 2023

A096208 Prime partial sums of the odd-indexed primes.

Original entry on oeis.org

2, 7, 89, 659, 1181, 5021, 9923, 10909, 11941, 17959, 26879, 48437, 53077, 65707, 71191, 74051, 119723, 135019, 147151, 173053, 226381, 293177, 323797, 362911, 411449, 470621, 478321, 542251, 575837, 592987, 646259, 721141, 730819, 740599
Offset: 1

Views

Author

Alonso del Arte, Jul 27 2004

Keywords

Comments

Subsequence of primes of A077131. - Michel Marcus, Oct 21 2015

Examples

			a(3) = 89 because 89 = 2 + 5 + 11 + 17 + 23 + 31.
		

Crossrefs

Intersection of A077131 and A000040.

Programs

  • Maple
    oip:= [seq(ithprime(i), i=1..10^4, 2)]:
    select(isprime, ListTools:-PartialSums(oip)); # Robert Israel, Jan 09 2025
  • Mathematica
    Select[Table[Plus @@ Prime[2Range[i] - 1], {i, 1000}], PrimeQ[ # ] &]
  • PARI
    lista(nn) = {s = 0; add = 1; forprime(p=1, nn, if (add, s += p; if (isprime(s), print1(s, ", "));); add = ! add;);} \\ Michel Marcus, Oct 21 2015

Extensions

Name clarified by Robert Israel, Jan 09 2025

A106738 Difference between the sums of odd-indexed primes and even-indexed primes up to and including index 10^n.

Original entry on oeis.org

13, 251, 4031, 52017, 652039, 7746369, 89721621, 1019145113, 11401770915, 126048548239
Offset: 1

Views

Author

Cino Hilliard, May 15 2005

Keywords

Crossrefs

Programs

  • Maple
    A106738 := proc(n) local a,i ; a :=0 ; for i from 1 to 10^n do a := a+(-1)^i*ithprime(i) ; od: RETURN(a) ; end: for n from 1 do print(A106738(n)) ; od: # R. J. Mathar, Feb 13 2008
  • Mathematica
    a[n_] := Module[{a = 0}, For[i = 1, i <= 10^n, i++, a = a + (-1)^i*Prime[i]]; a]; Table[Print[an = a[n]]; an, {n, 1, 8}] (* Jean-François Alcover, Dec 17 2012, after R. J. Mathar *)
  • PARI
    lista(pmax) = {my(pow = 10, k = 0, s = 0); forprime(p = 1, pmax, k++; s += ((-1)^k * p); if(k == pow, print1(s, ", "); pow *= 10));} \\ Amiram Eldar, Jul 02 2024

Formula

a(n) = Sum2 - Sum1, where Sum1 = prime(1) + prime(3) + ... + prime(10^n-1), and Sum2 = prime(2) + prime(4) + ... + prime(10^n).
a(n) = Sum_{i=1..10^n} (-1)^i*A000040(i). - R. J. Mathar, Feb 13 2008
a(n) = A077133(10^n/2). - Amiram Eldar, Jul 02 2024

Extensions

Edited by R. J. Mathar, Feb 13 2008
a(7)-a(8) from Donovan Johnson, Nov 30 2008
a(9)-a(10) from Amiram Eldar, Jul 02 2024

A355726 a(n) = a(n-2) + prime(n-1) for a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 2, 3, 7, 10, 18, 23, 35, 42, 58, 71, 89, 108, 130, 151, 177, 204, 236, 265, 303, 336, 376, 415, 459, 504, 556, 605, 659, 712, 768, 825, 895, 956, 1032, 1095, 1181, 1246, 1338, 1409, 1505, 1582, 1684, 1763, 1875, 1956, 2072, 2155, 2283, 2378, 2510
Offset: 0

Views

Author

Paul Curtz, Jul 15 2022

Keywords

Crossrefs

Cf. A077131 (even bisection), A077126 (odd bisection).
Cf. A008347 (first differences), (-1)^n*A330547 (second differences).

Programs

  • Mathematica
    Join[{0},Accumulate[FoldList[#2-#1&,0,Prime[Range[100]]]]] (* Paolo Xausa, Dec 04 2023 *)

Formula

a(2*n) = A077131(n), for n>=1.
a(2*n+1) = A077126(n), for n>=1.

A263549 Numbers k such that k divides the sum of the first k primes with odd indices.

Original entry on oeis.org

1, 3, 67, 141, 2201, 2625, 8153, 10187, 11089, 136515, 138377, 1543419, 1712109, 5097739, 51562297, 1459124841, 42825210689
Offset: 1

Views

Author

Altug Alkan, Oct 21 2015

Keywords

Comments

a(n) is always an odd number since the first prime is 2.
How do a(n) and A263546(n) compare asymptotically?

Examples

			1 is in the sequence because prime(1) = 2 is divisible by 1.
3 is in the sequence because prime(1) + prime(3) + prime(5) = 2 + 5 + 11 = 18 is divisible by 3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 10000, Divisible[Sum[Prime[2 i - 1], {i, 1, #}], #] &] (* Michael De Vlieger, Oct 21 2015 *)
  • PARI
    list(lim)=my(v=List(), k, s, t); forprime(p=2, , if((t++) && t%2==1, s+=p; k++; if(s%k==0, listput(v, k)); if(k>=lim, return(Vec(v)))))

Extensions

a(17) from Amiram Eldar, Jun 03 2024
Showing 1-6 of 6 results.