Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #21 Aug 12 2015 02:06:49
%S 2,6,11,12,3,18,81,90,81,942,1773,2532,77,1866,637,126,1725,56,2695,
%T 128,3647,6960,1295,7180,10809,430,10233,2944,3269,160,10919,9068,
%U 40925,22066,10763,558,1403,4344,2943,8894,9813,9308,4691,20516,13801,8056,36425
%N Smallest number k such that k^n is equal to the sum of n consecutive primes, or 1 if it does not exist.
%C Corresponding numbers m such that a(n)^n = Sum[Prime[i],{i,m,m+n-1}] are {1,7,85,689,13,...} (A162160).
%p isnp := proc(x,n) local xbar,p,psum,i ; xbar := floor(x/n) ; p := array(1..n) ; p[1] := nextprime(xbar) ; for i from 2 to n do p[i] := nextprime(p[i-1]) ; od ; psum := add(p[i],i=1..n) ; while psum >= x do if psum = x then RETURN(true) ; elif p[1] = 2 then RETURN(false) ; else psum := psum-p[n] ; for i from n to 2 by -1 do p[i] := p[i-1] ; od ; p[1] := prevprime(p[1]) ; psum := psum+p[1] ; fi ; od ; RETURN(false) ; end; A123112 := proc(n) local k ; k := 1 ; while true do if isnp(k^n,n) then RETURN(k) ; else k := k+1 ; fi ; od ; end; for n from 1 to 30 do print(A123112(n)) ; od ; # _R. J. Mathar_, Jan 13 2007
%o (PARI) print1(2); for(n=2, 10, k=n%2; until(s==t, k+=2; t=k^n; s=0; q=t\n; p=q+1; for(i=0, n-1, if(s*n<i*t, q=nextprime(q+1); s+=q, p=precprime(p-1); s+=p))); print1(", "k)) \\ _Jens Kruse Andersen_, Jul 23 2014
%Y Cf. A162160.
%K hard,nonn
%O 1,1
%A _Alexander Adamchuk_, Sep 28 2006
%E More terms from _R. J. Mathar_, Jan 13 2007
%E a(17)-a(26) from _Max Alekseyev_
%E a(27)-a(43) from _Donovan Johnson_, Nov 17 2008
%E a(44)-a(47) from _Jens Kruse Andersen_, Jul 23 2014