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.

A277583 Goldbach's problem extended to squares of prime gaps (>=2): smallest integer >= ((A078587(n) - A078496(n))^2)/n for n >= 4.

Original entry on oeis.org

1, 4, 1, 10, 5, 2, 4, 14, 1, 12, 3, 2, 3, 9, 1, 31, 2, 1, 15, 7, 5, 6, 2, 3, 12, 20, 1, 19, 11, 2, 2, 5, 3, 4, 9, 1, 1, 15, 1, 54, 1, 1, 20, 4, 3, 12, 1, 6, 7, 3, 4, 11, 1, 2, 16, 10, 1, 22, 6, 2, 1, 3, 2, 3, 14, 1, 1, 9, 1, 2, 13, 1, 1, 2, 2, 17, 5, 1, 11, 28, 2, 7, 1, 10, 4, 15
Offset: 4

Views

Author

Juri-Stepan Gerasimov, Oct 22 2016

Keywords

Comments

Where A078587(n) + A078496(n) = 2n and A078587(n) < A078496(n).

Examples

			a(5) = 4 because ((A078587(5) - A078496(5))^2)/5 = ((3 - 7)^2)/5 < 4, where 3 (prime) = 7 (prime) = 2*5;
a(6) = 1 because ((A078587(6) - A078496(6))^2)/6 = ((5 - 7)^2)/6 < 1, where 5 (prime) + 7 (prime) = 2*6;
a(7) = 10 because ((A078587(7) - A078496(7))^2)/7 = ((3 - 11)^2)/7 < 10, where 3 (prime) + 11 (prime) = 2*7.
		

Crossrefs

Cf. A002375, A078496, A078587, A277581 (Goldbach's problem extended to squares of prime gaps >= 0).

Programs

  • Mathematica
    Table[k = 1; While[k < ((Last@ # - First@ #)^2)/n, k++] &@ Block[{p = n + 1, q}, q = 2 n - p; While[q > 0 && Nand[PrimeQ@ p, PrimeQ@ q], p++; q--]; {p, q}]; k, {n, 4, 89}] (* or *)
    Table[Ceiling[4 (n - #)^2/n] &@ Block[{p = n + 1, q}, q = 2 n - p; While[q > 0 && Nand[PrimeQ@ p, PrimeQ@ q], p++; q--]; p], {n, 4, 89}] (* Michael De Vlieger, Oct 26 2016, after T. D. Noe at A078587 and Michel Marcus PARI *)
  • PARI
    maxp(n) = {my(p = precprime(n-1)); while(!isprime(2*n-p), p = precprime(p-1)); p;}
    a(n) = ceil(4*(n - maxp(n))^2/n); \\ Michel Marcus, Oct 22 2016