login
1/6 of product of three numbers: n-th prime, previous and following number.
7

%I #24 Mar 02 2023 16:44:52

%S 1,4,20,56,220,364,816,1140,2024,4060,4960,8436,11480,13244,17296,

%T 24804,34220,37820,50116,59640,64824,82160,95284,117480,152096,171700,

%U 182104,204156,215820,240464,341376,374660,428536,447580,551300,573800,644956

%N 1/6 of product of three numbers: n-th prime, previous and following number.

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

%F a(n) = A127918(n)/3. - _Michel Marcus_, Apr 09 2017

%t Table[(Prime[n] + 1) Prime[n](Prime[n] - 1)/6, {n, 1, 100}]

%t ((#-1)#(#+1))/6&/@Prime[Range[40]] (* _Harvey P. Dale_, Dec 23 2019 *)

%o (PARI) forprime(p=2,1e3,print1(binomial(p+1,3)", ")) \\ _Charles R Greathouse IV_, Jun 16 2011

%o (Python)

%o from sympy import prime

%o print([(prime(n) - 1)*prime(n)*(prime(n) + 1)//6 for n in range(1, 101)]) # _Indranil Ghosh_, Apr 09 2017

%o (Magma) [(NthPrime(n) + 1)*NthPrime(n)*(NthPrime(n) - 1)/6: n in [1..40]]; // _Vincenzo Librandi_, Apr 09 2017

%Y Cf. A036689, A034953, A127917, A127918, A127919.

%K nonn,easy

%O 1,2

%A _Artur Jasinski_, Feb 06 2007