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!)
A045985 a(n) = least k such that sum of first k primes is n times a prime. 2
1, 3, 10, 5, 3, 123, 8, 15, 20, 147, 8, 97, 92, 5, 414, 27, 120, 739, 144, 9, 86, 69, 858, 99, 62, 61, 26, 33, 7, 57, 456, 11, 76, 13, 180, 207, 58, 23, 166, 17, 38, 339, 10, 693, 242, 23, 1162, 169, 440, 9, 374, 117, 682, 187, 1284, 683, 70, 281, 48 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
EXAMPLE
a(3) = 10 because the partial sum of the first 10 primes is 3*43 = 129.
MATHEMATICA
a[n_] := Catch[For[p=0; sp=0; k=1, True, k++, p = NextPrime[p]; sp = sp+p; If[PrimeQ[sp/n], Throw[k]]]]; Table[a[n], {n, 1, 59}] (* Jean-François Alcover, Nov 13 2012 *)
Module[{nn=1500, p, t}, p=Accumulate[Prime[Range[nn]]]; t=Thread[{Range[ nn], p}]; Table[SelectFirst[t, PrimeQ[ #[[2]]/n]&], {n, 60}]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 16 2020 *)
PROG
(Haskell)
a045985 n = head [k | (k, x) <- zip [1..] a007504_list,
let (y, r) = divMod x n, r == 0, a010051' y == 1]
-- Reinhard Zumkeller, Oct 05 2015
CROSSREFS
Sequence in context: A192028 A111229 A100984 * A247034 A275511 A035411
KEYWORD
nice,nonn
AUTHOR
EXTENSIONS
More terms from David W. Wilson
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 April 17 22:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)