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

A270563 Integers k such that A086167(k) and A086168(k) are both prime.

Original entry on oeis.org

1, 15, 45, 105, 135, 231, 807, 1215, 1329, 1395, 1593, 1911, 2301, 2331, 2493, 3045, 3267, 3417, 3495, 3897, 4029, 4059, 4359, 4377, 4635, 4665, 4731, 5265, 6135, 6315, 6429, 6489, 6795, 6915, 6999, 7329, 7515, 7965, 8469, 8979, 9183, 9441, 10755, 11193, 12039
Offset: 1

Views

Author

Altug Alkan, Mar 19 2016

Keywords

Comments

A013916 lists numbers n such that the sum of the first n primes is prime. With similar motivation, twin prime pairs generate prime pairs in this sequence. Note that 2*n also gives the difference between members of prime pair that is generated by sum of first n twin prime pairs.
First differences of this sequence are 14, 30, 60, 30, 96, 576, ...

Examples

			15 is a term since A086167(15) = 1297 and A086168(15) = 1297 + 15*2 = 1327. 1297 and 1327 are both prime.
		

Crossrefs

Programs

  • Mathematica
    seq = {}; s1 = s2 = 0; c = n = 0; p = prv = 2; While[c < 45, p = NextPrime[p]; If[p == prv + 2, n++; s1 += prv; s2 += p; If[PrimeQ[s1] && PrimeQ[s2], c++; AppendTo[seq, n]]]; prv = p]; seq (* Amiram Eldar, Jan 03 2020 *)
  • PARI
    t(n, p=3) = {while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}
    s1(n) = sum(k=1, n, t(k));
    s2(n) = sum(k=1, n, t(k)+2);
    for(n=1, 1e3, if(ispseudoprime(s1(n)) && ispseudoprime(s2(n)), print1(n, ", ")));

Extensions

More terms from Amiram Eldar, Jan 03 2020

A086168 a(n) = sum of the first n upper twin primes.

Original entry on oeis.org

5, 12, 25, 44, 75, 118, 179, 252, 355, 464, 603, 754, 935, 1128, 1327, 1556, 1797, 2068, 2351, 2664, 3013, 3434, 3867, 4330, 4853, 5424, 6025, 6644, 7287, 7948, 8759, 9582, 10411, 11270, 12153, 13174, 14207, 15258, 16321, 17414, 18567
Offset: 1

Views

Author

Cino Hilliard, Aug 25 2003

Keywords

Examples

			For n = 4 we have twin prime pairs (3,5) (5,7) (11,13) (17,19) and 5 + 7 + 13 + 19 = 44.
		

Crossrefs

Programs

  • Mathematica
    lst={};s=0;Do[p=Prime[n];If[PrimeQ[p-2], s+=p;AppendTo[lst, s]], {n, 6!}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 30 2008 *)
    Accumulate[Transpose[Select[Partition[Prime[Range[200]],2,1],Last[#]-First[#]==2&]][[2]]]  (* Harvey P. Dale, Feb 08 2011 *)
  • PARI
    addnexttwin(n)= { s=0; for(x=1,n, if(prime(x+1)-prime(x)==2,s=s+prime(x+1); print1(s",")) ) }

A376891 Numbers k such that the sum of the first k lesser of twin primes is a lesser of twin prime.

Original entry on oeis.org

1, 23, 143, 251, 281, 305, 341, 455, 605, 761, 1349, 1613, 2765, 2903, 2981, 3623, 3725, 3923, 4049, 4133, 4745, 5207, 5303, 5489, 5765, 6515, 6611, 7793, 7835, 8153, 8237, 10427, 10697, 11261, 11447, 11627, 11729, 12401, 12701, 13871, 14327, 15359, 15683
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 08 2024

Keywords

Crossrefs

Programs

  • Maple
    K:= 1: count:= 1: s:= 3: k:= 1:
    for p from 5 by 6 do
      if isprime(p) and isprime(p+2) then
        k:= k+1;
        s:= s+p;
        if s mod 6 = 5 and isprime(s) and isprime(s+2) then
          count:= count+1; K:= K,k;
          if count = 100 then break fi;
    fi fi od:
    K; # Robert Israel, Oct 08 2024
  • Mathematica
    Position[Accumulate[Select[Partition[Prime[Range[200000]],2,1],#[[2]]-#[[1]]==2&][[;;,1]]],?(AllTrue[#+{0,2},PrimeQ]&)]//Quiet//Flatten (* _Harvey P. Dale, Jun 24 2025 *)
  • PARI
    lista(nn) = my(v=select(p->isprime(p+2), primes(nn)), s = vector(#v)); s[1] = v[1]; for (i=2, #v, s[i] = s[i-1]+v[i]); Vec(select(x->(isprime(x) && isprime(x+2)), s, 1)); \\ Michel Marcus, Oct 10 2024

A360226 a(n) = sum of the first n primes whose distance to next prime is 4.

Original entry on oeis.org

7, 20, 39, 76, 119, 186, 265, 362, 465, 574, 701, 864, 1057, 1280, 1509, 1786, 2093, 2406, 2755, 3134, 3531, 3970, 4427, 4890, 5377, 5876, 6489, 7132, 7805, 8544, 9301, 10070, 10893, 11746, 12605, 13482, 14365, 15272, 16209, 17176, 18185, 19272, 20365, 21578, 22857, 24154, 25457, 26880, 28309, 29756
Offset: 1

Views

Author

Artur Jasinski, Feb 01 2023

Keywords

Crossrefs

Programs

  • Mathematica
    ii = {}; sum = 0; Do[If[Prime[n + 1] - Prime[n] == 4, sum = sum + Prime[n]; AppendTo[ii, sum]], {n, 1, 250}]; ii

Formula

a(n) = Sum_{k=1..n} A029710(k).
a(n) = A172112(n+1) - 3.
Showing 1-4 of 4 results.