OFFSET
1,1
FORMULA
Multiply consecutive primes by Pi, truncate to integer, sum until a prime sum is reached.
EXAMPLE
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.
MAPLE
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
MATHEMATICA
Prime[#]&/@Flatten[Position[Accumulate[Table[Floor[Pi p], {p, Prime[Range[500]]}]], _?PrimeQ]] (* Harvey P. Dale, Jul 19 2023 *)
PROG
(UBASIC)
10 Ct=1
20 B=nxtprm(B)
30 C=int(pi(B))
40 D=D+C
41 print Ct, B, C, D
50 if D=prmdiv(D) then print D:stop
55 Ct=Ct+1
60 goto 20
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Mar 25 2006
EXTENSIONS
Corrected by R. J. Mathar, Oct 26 2006
STATUS
approved