login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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.
For pi(n^2) - pi(n)^2 see A291440. - Jonathan Sondow, Sep 10 2017
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
See A324799 for references. - N. J. A. Sloane, Sep 11 2019
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000 (terms 1..500 from G. C. Greubel)
FORMULA
a(n) = A001248(n) - A011757(n).
a(n) = commutator [A000040, A000290] at n.
a(n) = square(prime(n)) - prime(square(n)).
a(n) = A000290(A000040(n)) - A000040(A000290(n)). [corrected by Jonathan Sondow, Sep 10 2017]
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
f[n_] := Prime[n]^2 - Prime[n^2]; Array[f, 45] (* Robert G. Wilson v, Oct 29 2006 *)
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
Main diagonal of A324799.
Sequence in context: A142974 A259856 A279805 * A347356 A285441 A088885
KEYWORD
easy,sign
AUTHOR
Jonathan Vos Post, Oct 28 2006
EXTENSIONS
More terms from Robert G. Wilson v, Oct 29 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 10:55 EDT 2024. Contains 371241 sequences. (Running on oeis4.)