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.

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.

This page as a plain text file.
%I A321439 #39 Dec 15 2024 04:35:54
%S A321439 8,21,27,37,59,65,66,82,86,99,105,111,126,143,147,155,156,165,177,181,
%T A321439 187,194,195,200,230,231,242,262,284,374,430,449,460,477,502,512,539,
%U A321439 540,541,622,634,657,707,731,735,739,745,766,767,781,784,785,791,801
%N 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.
%C A321439 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.
%H A321439 Ray Chandler, <a href="/A321439/b321439.txt">Table of n, a(n) for n = 1..2500</a>
%e A321439 8 is a term because prime(8) = 19, A007504(19) = 568, and A007504(568) = 1086557, which is prime.
%e A321439 2 is not a term since prime(2) = 3, A007504(3) = 10 and A007504(10) = 129, which is not prime.
%p A321439 N:=100:
%p A321439 for n from 1 to N do
%p A321439 X:=add(ithprime(k),k=1..ithprime(n));
%p A321439 Y:=add(ithprime(r),r=1..X);
%p A321439 if isprime(Y)then print(n);
%p A321439 end if:
%p A321439 end do:
%t A321439 primeSum[n_] := Sum[Prime[i], {i, n}]; Select[Range[200], PrimeQ[ primeSum[primeSum[Prime[#]]]] &] (* _Amiram Eldar_, Nov 09 2018 *)
%o A321439 (Perl)
%o A321439 use ntheory qw(:all);
%o A321439 for (my ($i, $k) = (1, 1); ; ++$k) {
%o A321439     if (is_prime sum_primes nth_prime sum_primes nth_prime nth_prime $k) {
%o A321439         print "a($i) = $k\n"; ++$i;
%o A321439     }
%o A321439 } # _Daniel Suteu_, Nov 11 2018
%o A321439 (PARI)
%o A321439 sumprimes(n)={my(p=0, s=0); for(i=1, n, p=nextprime(1+p); s+=p); s}
%o A321439 ok(k)={isprime(sumprimes(sumprimes(prime(k))))}
%o A321439 for(n=1, 100, if(ok(n),print1(n, ", "))) \\ _Andrew Howroyd_, Nov 11 2018
%Y A321439 Cf. A007504, A013916, A321342, A321343.
%K A321439 nonn
%O A321439 1,1
%A A321439 _David James Sycamore_, Nov 09 2018
%E A321439 a(30)-a(54) from _Daniel Suteu_, Nov 11 2018