A075459 Duplicate of A050248.
2, 38, 110, 3066, 60020, 740282, 2340038, 29380602, 957565746
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
P:=Filtered([1..250],IsPrime);; a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Oct 07 2018
a007504 n = a007504_list !! n a007504_list = scanl (+) 0 a000040_list -- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
[0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1; A007504 := proc(n) add(ithprime(i), i=1..n) ; end proc: # R. J. Mathar, Sep 20 2015
Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *) primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
A007504(n) = sum(k=1,n,prime(k)) \\ Michael B. Porter, Feb 26 2010
a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
from itertools import accumulate, count, islice from sympy import prime def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0)) A007504_list = list(islice(A007504_gen(),20)) # Chai Wah Wu, Feb 23 2022
A007504 = Cases[Import["https://oeis.org/A007504/b007504.txt", "Table"], {, }][[All, 2]]; A045345 = Cases[Import["https://oeis.org/A045345/b045345.txt", "Table"], {, }][[All, 2]]; Table[A007504[[A045345[[n]] + 1]], {n, 1, 5}](* Robert Price, Mar 13 2020 *)
s=n=0; forprime(p=2, 1e9, if((s+=p)%n++==0, print1(s", "))) \\ Charles R Greathouse IV, Nov 07 2014
83 is the 23rd prime and (Sum_{i=1..23} p_i) / 23 = 874 / 23 = 38 (integer), so 83 is a term.
t = {}; sm = 0; Do[sm = sm + Prime[n]; If[Mod[sm, n] == 0, AppendTo[t, Prime[n]]], {n, 100000}]; t (* T. D. Noe, Mar 19 2013 *)
s=0; n=0; forprime(p=2, 1e7, s+=p; if(s%n++==0, print1(p", "))) \\ Charles R Greathouse IV, Jun 13 2012
a(2) = 67, because 67 is the 19th prime and the sum of the first 19 primes^2 = 24966 when divided by 19 equals 1314 which is an integer.
t = {}; sm = 0; Do[sm = sm + Prime[n]^2; If[Mod[sm, n] == 0, AppendTo[t, Prime[n]]], {n, 100000}]; t (* T. D. Noe, Mar 19 2013 *) k = 1; p = 2; s = 0; lst = {}; While[p < 1000000000, s = s + p^2; If[ Mod[s, k++] == 0, AppendTo[lst, p]]; p = NextPrime@ p]; lst (* Robert G. Wilson v, Mar 08 2015 *)
n=s=0; forprime(p=2,1e9, if((s+=p^2)%n++==0, print1(p", "))) \\ Charles R Greathouse IV, Feb 06 2015
k = 0; s = 1; p = 2; A128165 = {}; While[k < 247336000, If[Mod[s += p, ++k] == 0, AppendTo[A128165, k]; Print[{k, p}]]; p = NextPrime@ p]; A128165
is(n)=sum(i=1,n,prime(i),1)%n==0 \\ Charles R Greathouse IV, Nov 07 2014
n=0; s=1; forprime(p=2,1e9, s+=p; if(s%n++==0, print1(n", "))) \\ Charles R Greathouse IV, Nov 07 2014
n=s=0; forprime(p=2,1e8, s+=p^2; if(s%n++==0, print1(s", "))) \\ Charles R Greathouse IV, Apr 22 2015
s = 1; Do[s = s + Prime[n]^2; If[ Mod[s, n] == 0, Print[n]], {n, 700000}] (* or *) Select[Range[10^4], IntegerQ[(1 + Plus@@(Prime[Range[#]]^2))/#] &] (* Alonso del Arte, Jan 20 2011 *)
a(2) = 1314 is the average of squares of first 19 primes (24966/19=1314).
n=s=0; forprime(p=2,1e8, s+=p^2; if(s%n++==0, print1(s/n", "))) \\ Charles R Greathouse IV, Apr 22 2015
a(3) = 13, because 13 is the 6th prime and the sum of the first 6 primes+1 = 42 when divided by 6 equals 7 which is an integer.
t = {}; sm = 1; Do[sm = sm + Prime[n]; If[Mod[sm, n] == 0, AppendTo[t, Prime[n]]], {n, 100000}]; t (* Derived from A217599 *)
is(n)=if(!isprime(n),return(0)); my(t=primepi(n),s); forprime(p=2,n,s+=Mod(p,t)); s==0 \\ Charles R Greathouse IV, Nov 30 2013
Comments