login
Partial sums of primes, if 1 is regarded as a prime (as it was until quite recently, see A008578).
40

%I #51 Sep 08 2022 08:44:39

%S 1,3,6,11,18,29,42,59,78,101,130,161,198,239,282,329,382,441,502,569,

%T 640,713,792,875,964,1061,1162,1265,1372,1481,1594,1721,1852,1989,

%U 2128,2277,2428,2585,2748,2915,3088,3267,3448,3639,3832,4029

%N Partial sums of primes, if 1 is regarded as a prime (as it was until quite recently, see A008578).

%C Lexicographically earliest sequence whose first differences are an increasing sequence of primes. Complement of A175969. - _Jaroslav Krizek_, Oct 31 2010

%C A175944(a(n)) = A018252(n). - _Reinhard Zumkeller_, Mar 18 2011

%C Partial sums of noncomposite numbers (A008578). - _Omar E. Pol_, Aug 09 2012

%H Vincenzo Librandi, <a href="/A014284/b014284.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = Sum_{k <= n} [(A158611(k + 1)) * (A000012(n - k + 1))] = Sum_{k <= n} [(A158611(k + 1)) * (A000012(k))] = Sum_{k <= n} [(A008578(k)) * (A000012(n - k + 1))] = Sum_{k <= n} [(A008578(k)) * (A000012(k))] for n, k >= 1. - _Jaroslav Krizek_, Aug 05 2009

%F a(n + 1) = A007504(n) + 1. a(n + 1) - a(n) = A000040(n) = n-th primes. - _Jaroslav Krizek_, Aug 19 2009

%F a(n) = a(n-1) + prime(n-1), with a(1)=1. - _Vincenzo Librandi_, Jul 27 2013

%F G.f: (x*(1+b(x)))/(1-x) = c(x)/(1-x), where b(x) and c(x) are respectively the g.f. of A000040 and A008578. - _Mario C. Enriquez_, Dec 10 2016

%e a(7) = 42 because the first six primes (2, 3, 5, 7, 11, 13) add up to 41, and 1 + 41 = 42.

%p A014284 := proc(n)

%p add(A008578(i),i=1..n) ;

%p end proc:

%p seq(A014284(n),n=1..60) ; # _R. J. Mathar_, Mar 05 2017

%t Join[{1}, Table[1+Sum[Prime[j], {j,1,n}], {n,1,50}]] (* _Vladimir Joseph Stephan Orlovsky_, Sep 25 2009, modified by _G. C. Greubel_, Jun 18 2019 *)

%t Accumulate[Join[{1}, Prime[Range[45]]]] (* _Alonso del Arte_, Oct 09 2012 *)

%o (Haskell)

%o a014284 n = a014284_list !! n

%o a014284_list = scanl1 (+) a008578_list

%o -- _Reinhard Zumkeller_, Mar 26 2015

%o (PARI) concat([1], vector(50, n, 1 + sum(j=1,n, prime(j)) )) \\ _G. C. Greubel_, Jun 18 2019

%o (Magma) [1] cat [1 + (&+[NthPrime(j): j in [1..n]]): n in [1..50]]; // _G. C. Greubel_, Jun 18 2019

%o (Sage) [1]+[1 + sum(nth_prime(j) for j in (1..n)) for n in (1..50)] # _G. C. Greubel_, Jun 18 2019

%Y Cf. A007504.

%Y Equals A036439(n) - 1.

%Y Cf. A175965, A175966, A175967, A175968, A175969, A051349, A175970. - _Jaroslav Krizek_, Oct 31 2010

%Y Cf. A008578.

%K nonn,easy

%O 1,2

%A Deepan Majmudar (dmajmuda(AT)esq.com)

%E Correction for Aug 2009 change of offset in A158611 and A008578 by _Jaroslav Krizek_, Jan 27 2010