|
|
A008837
|
|
a(n) = p*(p-1)/2 for p = prime(n).
|
|
30
|
|
|
1, 3, 10, 21, 55, 78, 136, 171, 253, 406, 465, 666, 820, 903, 1081, 1378, 1711, 1830, 2211, 2485, 2628, 3081, 3403, 3916, 4656, 5050, 5253, 5671, 5886, 6328, 8001, 8515, 9316, 9591, 11026, 11325, 12246, 13203, 13861, 14878, 15931, 16290, 18145, 18528, 19306
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Whereas A034953 is the sequence of triangular numbers with prime indices, this is the sequence of triangular numbers with numbers one less than primes for indices. - Alonso del Arte, Aug 17 2014
a(n) is both the number of quadratic residues and the number of nonresidues modulo prime(n)^2 that are coprime to prime(n).
For k coprime to prime(n), k^a(n) == +-1 (mod prime(n)^2). (End)
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (phi(prime(n))^2 + phi(prime(n)))/2, where phi(n) is Euler's totient function, A000010. - Alonso del Arte, Aug 22 2014
|
|
MAPLE
|
a:= n-> (p-> p*(p-1)/2)(ithprime(n)):
|
|
MATHEMATICA
|
|
|
PROG
|
(Magma) [ (k-1)*k/2 where k is NthPrime(n): n in [1..44] ]; // Klaus Brockhaus, Nov 18 2008
(PARI) { n=0; forprime (p=2, prime(1000), write("b008837.txt", n++, " ", p*(p - 1)/2) ) } \\ Harry J. Smith, Jul 25 2009
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|