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.

A117504 Prime at which the cumulative sum in A117503 is prime.

This page as a plain text file.
%I A117504 #13 Apr 21 2024 11:38:36
%S A117504 37,137,151,173,409,467,503,677,937,1091,1153,1229,1303,1409,1453,
%T A117504 1471,1531,2137,2221,2251,2393,2503,2593,2633,2671,2797,2837,3001,
%U A117504 3023,3089,3163
%N A117504 Prime at which the cumulative sum in A117503 is prime.
%F A117504 Multiply consecutive primes by Pi, truncate to integer, sum until a prime sum is reached.
%e A117504 In a(1)=37, the cumulative sum of primes 1-12 in A117503 has risen to 613, a prime -- 37 being the 12th prime to be multiplied by Pi, with integer of result added to previous results.
%p A117504 Digits := 30 ; A117504 := proc(nmax) local a,pisum,p ; a := [] ; pisum := 0 ; p :=1 ; while nops(a) <=nmax do while true do pisum := pisum+floor(Pi*ithprime(p)) ; p := p+1 ; if isprime(pisum) then a := [op(a),ithprime(p-1)] ; break ; fi ; od : od : RETURN(a) ; end: a := A117504(30) ; # _R. J. Mathar_
%t A117504 Prime[#]&/@Flatten[Position[Accumulate[Table[Floor[Pi p],{p,Prime[Range[500]]}]],_?PrimeQ]] (* _Harvey P. Dale_, Jul 19 2023 *)
%o A117504 (UBASIC)
%o A117504 10 Ct=1
%o A117504 20 B=nxtprm(B)
%o A117504 30 C=int(pi(B))
%o A117504 40 D=D+C
%o A117504 41 print Ct,B,C,D
%o A117504 50 if D=prmdiv(D) then print D:stop
%o A117504 55 Ct=Ct+1
%o A117504 60 goto 20
%Y A117504 Cf. A117503.
%K A117504 easy,nonn
%O A117504 1,1
%A A117504 _Enoch Haga_, Mar 25 2006
%E A117504 Corrected by _R. J. Mathar_, Oct 26 2006