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

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
Showing 1-1 of 1 results.