login
a(n) = n + 1 + 2*Sum_{j=0..n-2} (j*prime(n-j+2) - (2*j-1)*prime(n-j+1) + (j-1)*prime(n-j)).
1

%I #12 Dec 28 2022 09:02:35

%S 2,7,12,25,30,43,48,61,82,87,108,121,126,139,160,181,186,207,220,225,

%T 246,259,280,309,322,327,340,345,358,411,424,445,450,487,492,513,534,

%U 547,568,589,594,631,636,649,654,699,744,757,762,775

%N a(n) = n + 1 + 2*Sum_{j=0..n-2} (j*prime(n-j+2) - (2*j-1)*prime(n-j+1) + (j-1)*prime(n-j)).

%H G. C. Greubel, <a href="/A122264/b122264.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = n + 1 + 2*Sum_{j=0..n-2} (j*prime(n-j+2) - (2*j-1)*prime(n-j+1) + (j-1)*prime(n-j)) with a(1) = 2.

%t a[n_]:= n+1 +2*Sum[j*Prime[n-j+2] -(2*j-1)*Prime[n-j+1] +(j-1)*Prime[n -j], {j,0,n-2}];

%t Table[a[n], {n, 60}] (* _G. C. Greubel_, Dec 26 2022 *)

%o (Magma)

%o P:=NthPrime;

%o A122264:= func< n | n eq 1 select 2 else n+1+2*(&+[j*P(n-j+2) -(2*j-1)*P(n-j+1) +(j-1)*P(n-j) : j in [0..n-2]]) >;

%o [A122264(n): n in [1..60]]; // _G. C. Greubel_, Dec 26 2022

%o (SageMath)

%o p=nth_prime

%o def A122264(n): return n+1 +2*sum(j*p(n-j+2) -(2*j-1)*p(n-j+1) +(j-1)*p(n-j) for j in range(n-1))

%o [a122264(n) for n in range(1,61)] # _G. C. Greubel_, Dec 26 2022

%K nonn,easy,less

%O 1,1

%A _Roger L. Bagula_, Oct 18 2006

%E Edited by _G. C. Greubel_, Dec 26 2022