login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068873 Smallest prime which is a sum of n distinct primes. 8
2, 5, 19, 17, 43, 41, 79, 83, 127, 131, 199, 197, 283, 281, 379, 389, 499, 509, 643, 641, 809, 809, 983, 971, 1171, 1163, 1381, 1373, 1609, 1607, 1861, 1861, 2137, 2137, 2437, 2441, 2749, 2767, 3109, 3109, 3457, 3457, 3833, 3847, 4243, 4241, 4663, 4679, 5119 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

REFERENCES

Shantanu Dey & Moloy De, "Two Conjectures On Prime Numbers", Jour. Of  Recreational Mathematics, Vol. 36 (3) pp 205-206, Baywood Publ. Co, Amityville NY 2011.

LINKS

Table of n, a(n) for n=1..49.

FORMULA

Min(a(n), A073619(n)) = A007504(n) for n > 1. - Jonathan Sondow, Jul 10 2012

EXAMPLE

a(3) = 19 as 19 is the smallest prime which can be expressed as the sum of three primes as 19 = 3 + 5 + 11. a(4) = 17= 2+3+5+7. a(2)=A038609(1). a(3)=A124867(7). Further examples in A102330.

MAPLE

# Number of ways to write n as a sum of k distinct primes, the smallest

# being smalp

sumkprims := proc(n, k, smalp)

    option remember;

    local a, res, pn;

    res := n-smalp ;

    if res < 0 then

        return 0;

    elif res > 0 and k <=0 then

        return 0;

    elif res = 0 and k = 1 then

        return 1;

    else

        pn := nextprime(smalp) ;

        a := 0 ;

        while pn <= res do

            a := a+procname(res, k-1, pn) ;

            pn := nextprime(pn) ;

        end do:

        a ;

    end if;

end proc:

# Number of ways of writing n as a sum of k distinct primes

A000586k := proc(n, k)

    local a, i, smalp ;

    a := 0 ;

    for i from 1 do

        smalp := ithprime(i) ;

        if k*smalp > n then

            return a;

        end if;

        a := a+sumkprims(n, k, smalp) ;

    end do:

end proc:

# Smallest prime which is a sum of n distinct primes

A068873 := proc(n)

    local a, i;

    a := A007504(n) ;

    a := nextprime(a-1) ;

    for i from 1 do

        if A000586k(a, n) > 0 then

            return a;

        end if;

        a := nextprime(a) ;

    end do:

end proc: # R. J. Mathar, May 04 2014

PROG

(PARI) a(n)=

{

    my(P=primes(n), k=n, t);

    while(1,

        forvec(v=vector(n-1, i, [1, k-1]),

            t=sum(i=1, n-1, P[v[i]])+P[k];

            if(isprime(t), return(t))

        ,

            2 \\ flag: only strictly increasing vectors v

        );

        P=concat(P, nextprime(P[k]+1));

        k++

    );

} \\ Charles R Greathouse IV, Sep 19 2015

CROSSREFS

Cf. A102330, A013918, A007504.

Sequence in context: A289126 A062097 A125765 * A035091 A045367 A045368

Adjacent sequences:  A068870 A068871 A068872 * A068874 A068875 A068876

KEYWORD

nonn

AUTHOR

Amarnath Murthy, Mar 19 2002

EXTENSIONS

More terms from Sascha Kurz, Feb 03 2003

Corrected by Ray Chandler, Feb 02 2005

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 19:22 EDT 2018. Contains 316271 sequences. (Running on oeis4.)