login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339185 a(n) is the least prime p such that the sum of n consecutive primes starting with p has exactly n prime factors, counted with multiplicity, or 0 if no such p exists. 1
2, 0, 137, 5, 41, 109, 4253, 569, 23057, 821, 405863, 9013, 1049173, 73009, 9742969, 188017, 382355863, 236527, 3198295691, 1843111, 21640201361, 7600499, 376724314301, 33177461, 1974496270177, 305216017, 85571500507397, 148597987, 145412255489161, 951267841, 2609815945304401, 1140850357, 24575914221842531 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Conjecture: Such p exists for every n > 2.

LINKS

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

FORMULA

A339269(n) = A143121(a(n)+n, a(n)).

EXAMPLE

a(3)=137 because the sum of 3 consecutive primes starting with 137 is 137+139+149=425=5^2*7 is the product of 3 primes counting multiplicity, and 137 is the least prime with this property.

MAPLE

sumofconsecprimes:= proc(x, n)

  local P, k, p, q, t;

  P:= nextprime(floor(x/n));

  p:= P; q:= P;

  for k from 1 to n-1 do

    if k::even or q = 2 then p:= nextprime(p); P:= P, p;

    else q:= prevprime(q); P:= q, P;

    fi

  od;

  P:= [P];

  t:= convert(P, `+`);

  if t = x then return P fi;

  if t > x then

    while t > x do

      if q = 2 then return false fi;

      q:= prevprime(q);

      t:= t + q - p;

      P:= [q, op(P[1..-2])];

      p:= P[-1];

      if t = x then return P fi;

    od

  else

    while t < x do

      p:= nextprime(p);

      t:= t + p - q;

      P:= [op(P[2..-1]), p];

      q:= P[1];

      if t = x then return P fi;

    od

  fi;

  false

end proc:

children:= proc(r) local L, x, p, q, t, R;

  x:= r[1];

  L:= r[2];

  t:= L[-1];

  p:= t[1]; q:= nextprime(p);

  if t[2]=1 then t:= [q, 1];

  else t:= [p, t[2]-1], [q, 1]

  fi;

  R:= [x*q/p, [op(L[1..-2]), t]];

  if nops(L) >= 2 then

    p:= L[-2][1];

    q:= L[-1][1];

    if L[-2][2]=1 then t:= [q, L[-1][2]+1]

    else t:= [p, L[-2][2]-1], [q, L[-1][2]+1]

    fi;

    R:= R, [x*q/p, [op(L[1..-3]), t]]

  fi;

  [R]

end proc:

f:= proc(n) local Q, t, x, v;

      uses priqueue;

      initialize(Q);

      if n::even then insert([-2^n, [[2, n]]], Q)

      else insert([-3^n, [[3, n]]], Q)

      fi;

      do

        t:= extract(Q);

        x:= -t[1];

        v:= sumofconsecprimes(x, n);

        if v <> false then return v[1] fi;

        for t in children(t) do insert(t, Q) od;

      od

   end proc:

f(1):= 2:

f(2):= 0:

map(f, [$1..34]);

CROSSREFS

Cf. A001222, A143121, A339269.

Sequence in context: A033838 A181373 A046065 * A003321 A012333 A012329

Adjacent sequences:  A339182 A339183 A339184 * A339186 A339187 A339188

KEYWORD

nonn

AUTHOR

J. M. Bergot and Robert Israel, Nov 26 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 6 20:00 EDT 2022. Contains 357270 sequences. (Running on oeis4.)