login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = (prime(n)^2 - 1)/8.
3

%I #38 May 04 2024 03:59:01

%S 1,3,6,15,21,36,45,66,105,120,171,210,231,276,351,435,465,561,630,666,

%T 780,861,990,1176,1275,1326,1431,1485,1596,2016,2145,2346,2415,2775,

%U 2850,3081,3321,3486,3741,4005,4095,4560,4656,4851,4950,5565,6216,6441

%N a(n) = (prime(n)^2 - 1)/8.

%C This sequence is a subsequence of the triangular numbers (A000217) because (prime(n)^2-1)/8 = ((2m+1)^2-1)/8 = m(m+1)/2 where p=2m+1 for a given m. - _David Morales Marciel_, Oct 07 2015

%C The Jacobi symbol (2|p) = (-1)^((p^2-1)/8). - _Michael Somos_, Feb 17 2020

%C Number of inversions of the permutation ((2*i) mod p)_{1<=i<=p-1} = (2,4,...,p-1,1,3,...,p-2) of {1,2,...,p-1}, where p = prime(n). - _Jianing Song_, Apr 07 2023

%D J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 307.

%H Harvey P. Dale, <a href="/A061066/b061066.txt">Table of n, a(n) for n = 2..1000</a>

%F a(n) = A000217(A005097(n-1)). - after first comment, _Michel Marcus_, Oct 07 2015

%F a(n) = (3/8)*A024700(n-2). - _G. C. Greubel_, May 03 2024

%e a(2) = 1 because p = prime(2) = 3 and (3^2-1)/8 = 1. - _Michael Somos_, Feb 17 2020

%t f[n_]:=(Prime[n]^2-1)/8; Array[f,66,2] (* _Vladimir Joseph Stephan Orlovsky_, Aug 06 2009 *)

%t (#^2-1)/8&/@Prime[Range[2,50]] (* _Harvey P. Dale_, Nov 16 2012 *)

%o (PARI) vector(100, n, (prime(n+1)^2 - 1)/8) \\ _Altug Alkan_, Oct 07 2015

%o (Magma) [(p^2-1)/8: p in PrimesInInterval(3,300)]; // _G. C. Greubel_, May 03 2024

%o (SageMath) [(n^2-1)/8 for n in prime_range(3,301)] # _G. C. Greubel_, May 03 2024

%Y Cf. A000217, A005097, A024700.

%K nonn

%O 2,2

%A _Labos Elemer_, May 28 2001