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

A321342 Numbers k such that if j is the sum of the first k primes, then the sum of the first j primes is prime.

Original entry on oeis.org

1, 9, 15, 19, 73, 85, 87, 103, 121, 157, 175, 277, 313, 317, 341, 357, 375, 385, 391, 421, 443, 447, 523, 525, 539, 571, 607, 611, 645, 701, 779, 783, 791, 799, 823, 831, 835, 853, 889, 907, 911, 925, 977, 1051, 1075, 1081, 1087, 1095, 1117, 1125, 1135, 1157, 1181, 1187, 1223, 1257, 1305, 1325
Offset: 1

Views

Author

David James Sycamore, Nov 06 2018

Keywords

Comments

k is in the sequence if A007504(j) is prime, where j = A007504(k). A007504(j) must be odd to be prime, so j must be even and k must be odd. Therefore all terms are odd. The subsequence of primes is A321343.

Examples

			A007504(1) = 2 and A007504(2) = 5, a prime therefore 1 is a term.
A007504(3) = 10 and A007504(10) = 129, not prime, therefore 3 is not a term.
A007504(9) = 100 and A007504(100) = 24133, a prime so 9 is a term.
		

Crossrefs

Programs

  • Maple
    N:=2000:
    for n from 1 to N by 2 do
    X:=add(ithprime(r),r=1..n);
    Y:=add(ithprime(k),k=1..X);
    if isprime(Y) then print(n);
    end if:
    end do:
  • Mathematica
    primeSum[n_] := Sum[Prime[i], {i, n}]; Select[Range[300], PrimeQ[primeSum[primeSum[#]]] &] (* Amiram Eldar, Nov 07 2018 *)
  • PARI
    sfp(n) = sum(k=1, n, prime(k)); \\ A007504
    isok(n) = isprime(sfp(sfp(n))); \\ Michel Marcus, Nov 08 2018

A321439 Numbers k such that if j is the sum of the first prime(k) primes then the sum of the first j primes is prime.

Original entry on oeis.org

8, 21, 27, 37, 59, 65, 66, 82, 86, 99, 105, 111, 126, 143, 147, 155, 156, 165, 177, 181, 187, 194, 195, 200, 230, 231, 242, 262, 284, 374, 430, 449, 460, 477, 502, 512, 539, 540, 541, 622, 634, 657, 707, 731, 735, 739, 745, 766, 767, 781, 784, 785, 791, 801
Offset: 1

Views

Author

David James Sycamore, Nov 09 2018

Keywords

Comments

Numbers k such that A007504(A007504(prime(k))) is prime. Terms can be even or odd since A007504(A007504(prime(k))) is odd for any k.

Examples

			8 is a term because prime(8) = 19, A007504(19) = 568, and A007504(568) = 1086557, which is prime.
2 is not a term since prime(2) = 3, A007504(3) = 10 and A007504(10) = 129, which is not prime.
		

Crossrefs

Programs

  • Maple
    N:=100:
    for n from 1 to N do
    X:=add(ithprime(k),k=1..ithprime(n));
    Y:=add(ithprime(r),r=1..X);
    if isprime(Y)then print(n);
    end if:
    end do:
  • Mathematica
    primeSum[n_] := Sum[Prime[i], {i, n}]; Select[Range[200], PrimeQ[ primeSum[primeSum[Prime[#]]]] &] (* Amiram Eldar, Nov 09 2018 *)
  • PARI
    sumprimes(n)={my(p=0, s=0); for(i=1, n, p=nextprime(1+p); s+=p); s}
    ok(k)={isprime(sumprimes(sumprimes(prime(k))))}
    for(n=1, 100, if(ok(n),print1(n, ", "))) \\ Andrew Howroyd, Nov 11 2018
  • Perl
    use ntheory qw(:all);
    for (my ($i, $k) = (1, 1); ; ++$k) {
        if (is_prime sum_primes nth_prime sum_primes nth_prime nth_prime $k) {
            print "a($i) = $k\n"; ++$i;
        }
    } # Daniel Suteu, Nov 11 2018
    

Extensions

a(30)-a(54) from Daniel Suteu, Nov 11 2018
Showing 1-2 of 2 results.