|
|
A123914
|
|
a(n) = prime(n)^2 - prime(n^2). Commutator of (primes, squares) at n.
|
|
9
|
|
|
2, 2, 2, -4, 24, 18, 62, 50, 110, 300, 300, 542, 672, 656, 782, 1190, 1602, 1578, 2052, 2300, 2246, 2780, 3086, 3710, 4772, 5150, 5090, 5442, 5400, 5772, 8556, 9000, 10032, 9980, 12270, 12174, 13328, 14520, 15146, 16430, 17714, 17660, 20604, 20502, 21200
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(4) = -4 is the only negative value. All values are even. Asymptotically a(n) ~ (n log n)^2 - (n^2) log (n^2) = (n^2)*(log n)^2 - 2*(n^2)*(log n) = (n^2)*((log n)^2 - 2*log n) = O((n^2)*(log n)^2) which is the same as the asymptotic of commutator [primes, triangular numbers] at n, or, for that matter, commutator [primes, k-tonal numbers] at n for any k > 2.
Proof that a(n) > 0 for n <> 4: It is known that pi(k^2) >= pi(k)^2 for k <> 7 (see A291440). Take k = prime(n) to get pi(prime(n)^2) >= pi(prime(n))^2 = n^2 for prime(n) <> 7 = prime(4). Thus for n <> 4 there are at least n^2 primes <= prime(n)^2, so prime(n^2) <= prime(n)^2, implying a(n) >= 0. But a prime cannot equal a square, so a(n) > 0 for n <> 4. - Jonathan Sondow, Nov 04 2017
|
|
REFERENCES
|
|
|
LINKS
|
|
|
FORMULA
|
a(n) = square(prime(n)) - prime(square(n)).
|
|
EXAMPLE
|
a(1) = prime(1)^2 - prime(1^2) = prime(1)^2 - prime(1^2) = 4 - 2 = 2.
a(2) = prime(2)^2 - prime(2^2) = prime(2)^2 - prime(2^2) = 9 - 7 = 2.
a(3) = prime(3)^2 - prime(3^2) = prime(3)^2 - prime(3^2) = 25 - 23 = 2.
a(4) = prime(4)^2 - prime(4^2) = prime(4)^2 - prime(4^2) = 49 - 53 = -4.
a(5) = prime(5)^2 - prime(5^2) = prime(5)^2 - prime(5^2) = 121 - 97 = 24.
|
|
MATHEMATICA
|
Table[(Prime[n])^2 - Prime[n^2], {n, 1, 300}] (* G. C. Greubel, Sep 15 2015 *)
|
|
PROG
|
(Magma) [NthPrime(n)^2 - NthPrime(n^2): n in [1..60]]; // Vincenzo Librandi, Sep 16 2015
(PARI) vector(100, n, prime(n)^2 - prime(n^2)) \\ Altug Alkan, Oct 05 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,sign
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|