Re^2: Error-finding program

Richard Mathar mathar at strw.leidenuniv.nl
Thu Oct 26 18:53:08 CEST 2006


> From seqfan-owner at ext.jussieu.fr  Wed Oct 25 21:07:37 2006
> Return-Path: <seqfan-owner at ext.jussieu.fr>
> To: seqfan at ext.jussieu.fr
> Subject: Re: Error-finding program
> Date: Wed, 25 Oct 2006 15:05:48 -0400
> ...
> A117504 There's something seriously wrong here, but I don't know just 
> what.
> ...

This is what I get for A117504, monotonic as it must be:

a := [37, 137, 151, 173, 409, 467, 503, 677, 937, 1091, 1153, 1229, 1303, 1409,

    1453, 1471, 1531, 2137, 2221, 2251, 2393, 2503, 2593, 2633, 2671, 2797,

    2837, 3001, 3023, 3089, 3163]

using in 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) ;

I submitted the Maple program of the corresponding A117503 (which
is correct) already to the OEIS; everybody is free to do the same
with the artwork above.... 

Explanation of the erroneous version of A117504: it contains up to n=10 the primes,
and for n>=11 the prime indices, so instead of 191 we need to have
1153 which is the 191th prime, instead of 201 the 201st prime etc.

RJM






More information about the SeqFan mailing list