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-2 of 2 results.

A225576 Numbers n such that n^2 = prime(i)*prime(i+3) + prime(j)^2, for some i, j > 0, and such that prime(i+3) = prime(i) + 2*prime(j).

Original entry on oeis.org

12, 18, 30, 42, 54, 60, 96, 102, 108, 120, 144, 150, 156, 174, 186, 210, 228, 252, 264, 270, 294, 312, 408, 420, 426, 456, 462, 510, 534, 540, 552, 558, 564, 570, 582, 588, 594, 600, 606, 654, 672, 696, 714, 774, 816
Offset: 1

Views

Author

Richard R. Forberg, May 10 2013

Keywords

Comments

In all solutions of this equation n is divisible by 6.
The solution values for n = prime(i) + prime (j), when restricted by the condition prime(i+3) = prime (i) + 2*prime(j). Rather than being overly restrictive, the condition applies to the most prevalent type of solution to the equation above for n^2. See A225461 for details.
The equation is member of an infinite family of similar equations written as: n^2 = prime(i)*prime(i+d) + prime(j)^2, for any i,j, or d > 0. In this instance d = 3.
There are some additional solutions for n that do NOT obey the condition above. These are sparse but include: 60 (a 2nd time), 150, 1434, 4584 and 5190 all of which occur at low values of prime(i) and which obey the condition: n = prime(j) + 1. These are also divisible by 6, but they are excluded from the listing above.

Examples

			12 is a solution value for N because 12^2 = 7*17 + 5^2 and 17 is the third prime after 7.
		

References

Crossrefs

Cf. A000040.

Programs

  • PARI
    is(n)=my(p=2,q=3,r=5,t);forprime(s=7,n+160,if(issquare(n^2-p*s,&t) && isprime(t), return(1));p=q;q=r;r=s); 0 \\ Charles R Greathouse IV, May 13 2013

A350472 Positive integers k such that if p is the next prime > k, and q is the previous prime < k, then p - k is prime and k - q is prime.

Original entry on oeis.org

5, 9, 15, 21, 26, 34, 39, 45, 50, 56, 64, 69, 76, 81, 86, 92, 94, 99, 105, 111, 116, 120, 124, 129, 134, 142, 144, 146, 154, 160, 165, 170, 176, 184, 186, 188, 195, 204, 206, 216, 218, 225, 231, 236, 244, 246, 248, 254, 260, 266, 274, 279, 286, 288, 290, 296
Offset: 1

Views

Author

Ryan Bresler, Jan 01 2022

Keywords

Comments

a(n) can only be composite (excluding a(1) = 5).

Examples

			9 is a term because the next prime > 9 is 11 and the previous prime < 9 is 7, and 11 - 9 = 2 (which is prime) and 9 - 7 = 2 (which is also prime).
		

Crossrefs

Intersection of A350496 and A350460.

Programs

  • Maple
    q:= n-> andmap(isprime, [nextprime(n)-n, n-prevprime(n)]):
    select(q, [$3..400])[];  # Alois P. Heinz, Jan 01 2022
  • Mathematica
    Select[Range[350], And @@ PrimeQ[{# - NextPrime[#, -1], NextPrime[#] - #}] &] (* Amiram Eldar, Jan 01 2022 *)
  • PARI
    isok(k) = my(p=nextprime(k+1), q=precprime(k-1)); isprime(p-k) && isprime(k-q); \\ Michel Marcus, Jan 01 2022
  • Python
    from sympy import isprime, nextprime, prevprime
    def ok(n):
        return n > 2 and isprime(nextprime(n) - n) and isprime(n - prevprime(n))
    print([k for k in range(341) if ok(k)]) # Michael S. Branicky, Jan 01 2022
    
Showing 1-2 of 2 results.