cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A339640 a(n) = (A062772(n) + A054270(n)) / 2 - A001248(n).

Original entry on oeis.org

0, 0, 1, 1, -1, 1, -1, 2, 3, 5, -1, 1, 0, 5, 1, 2, -1, 2, -1, 4, -1, -3, 2, 2, -1, 1, 1, 8, -4, 3, 4, 2, -4, 5, 10, -4, -4, -2, -1, 8, -1, -1, 5, -1, 3, -7, 4, 4, 1, 2, 1, 4, 5, 8, 8, 8, -1, 2, -4, -2, 3, 1, -8, -4, 1, -1, -4, 10, -2, 15, 8, 10, 2
Offset: 1

Views

Author

Dimitris Valianatos, Dec 11 2020

Keywords

Comments

Conjecture: The partial sums of this sequence are greater than or equal to zero. This means that the squares of the prime numbers are smaller than the average of the previous and the next prime number most of the time.

Examples

			For n = 10 prime(10)^2 = 29^2 = 841. The previous prime of 841 is 839 and the next 853. The average of 839 and 853 is (839 + 853)/2 = 846. So a(10) = 846 - 841 = 5.
		

Crossrefs

Programs

  • Maple
    f:= p -> (nextprime(p^2) + prevprime(p^2))/2 - p^2:
    map(f, [seq(ithprime(i),i=1..100)]); # Robert Israel, Nov 24 2024
  • Mathematica
    Array[(Total@ NextPrime[#, {-1, 1}])/2 - # &[Prime[#]^2] &, 73] (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    forprime(n = 2, 370, print1((nextprime(n^2) + precprime(n^2)) / 2 - n^2", "))

Formula

a(n) = (nextprime(prime(n)^2) + precprime(prime(n)^2)) / 2 - prime(n)^2.

A091666 Difference between prime(n)^2 and the next prime.

Original entry on oeis.org

1, 2, 4, 4, 6, 4, 4, 6, 12, 12, 6, 4, 12, 12, 4, 10, 10, 6, 4, 10, 4, 6, 10, 6, 4, 10, 4, 18, 6, 12, 10, 6, 4, 12, 28, 6, 10, 4, 4, 18, 10, 10, 12, 4, 12, 6, 10, 10, 10, 12, 4, 10, 18, 28, 18, 22, 6, 12, 4, 16, 18, 4, 4, 10, 4, 4, 6, 22, 4, 42, 24, 22, 10, 4
Offset: 1

Views

Author

Pierre CAMI, Jan 27 2004

Keywords

Comments

Conjecturally, a(n) << log^2 n (with constant around 8/e^gamma in the supremum). [Charles R Greathouse IV, Dec 27 2011]
Except for a(2)=2, there are no terms = 2 mod 6 (as p^2+2 = 0 mod 3 for primes p > 3). Also, only 1 and 2 appear once while all other terms may appear (infinitely) many times. [Zak Seidov, Apr 18 2012]

Examples

			prime(3)=5, 5*5=25 for k=4 25+4=29 prime, k=4 is the least k with prime(3)^2 + k prime.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[#^2]-#^2&/@Prime[Range[74]] (* Zak Seidov, Apr 18 2012 *)
  • PARI
    a(n) = my(x=prime(n)^2); nextprime(x)-x; \\ Michel Marcus, Oct 07 2023

Formula

Conjecture: Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} log(prime(n))) = 2. - Alain Rocchelli, Oct 04 2023

A062773 Index of the smallest prime which follows square of n-th prime.

Original entry on oeis.org

3, 5, 10, 16, 31, 40, 62, 73, 100, 147, 163, 220, 264, 284, 330, 410, 488, 520, 610, 676, 706, 812, 887, 1001, 1164, 1253, 1295, 1382, 1424, 1524, 1878, 1977, 2142, 2191, 2490, 2548, 2730, 2916, 3044, 3242, 3437, 3513, 3869, 3946, 4090, 4165, 4628
Offset: 1

Views

Author

Labos Elemer, Jul 18 2001

Keywords

Examples

			100th prime, 541 immediately follows 529, square of 9th prime, a(9)=100.
		

Crossrefs

Programs

  • Mathematica
    PrimePi[NextPrime[#]]&/@(Prime[Range[50]]^2) (* Harvey P. Dale, Apr 12 2023 *)
  • PARI
    a(n) = { primepi(prime(n)^2) + 1 } \\ Harry J. Smith, Aug 10 2009

Formula

a(n) = pi( nextprime( prime(n)^2 ) ).
a(n) = A000720(A062772(n)). - Michel Marcus, Jun 24 2014

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Aug 10 2009
Showing 1-3 of 3 results.