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.

A379018 a(n) is the least prime p such that p^2 < n and n - p^2 is not squarefree, or -1 if there is no such p.

Original entry on oeis.org

-1, -1, -1, -1, -1, -1, -1, 2, -1, -1, -1, 2, 2, -1, -1, 2, 3, 3, -1, 2, 3, 2, -1, 2, 3, -1, 3, 2, 2, -1, 2, 2, 3, 3, -1, 2, 3, -1, -1, 2, 3, -1, 5, 2, 3, -1, -1, 2, 2, 5, -1, 2, 2, 2, -1, 2, 3, 2, 3, 2, 3, -1, 3, 2, 3, -1, 2, 2, 3, 5, -1, 2, 3, 5, 5, 2, 3, -1, 2, 2, 3, -1, -1, 2, 2, -1, -1, 2, 3
Offset: 1

Views

Author

Robert Israel, Dec 13 2024

Keywords

Comments

a(n) is the least p, if it exists, such that there is a solution to the equation n = p^2 + k * q^2 with p and q prime and k > 0.

Examples

			a(17) = 3 because 17 - 3^2 = 8 is not squarefree, while 17 - 2^2 = 13 is squarefree.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
      p:= 2;
      while p^2 <= n do
        if not numtheory:-issqrfree(n-p^2) then return p fi;
        p:= nextprime(p);
      od;
      -1
    end proc:
    map(f, [$1..200]);

A377842 a(n) = q - 2*p, where q is the greatest prime such that p=2*n - q is also prime.

Original entry on oeis.org

-2, -3, -1, 1, -3, 5, 7, 3, 11, 13, 9, 17, 13, 9, 23, 25, 21, 17, 31, 27, 35, 37, 33, 41, 37, 33, 47, 43, 39, 53, 55, 51, 47, 61, 57, 65, 67, 63, 59, 73, 69, 77, 73, 69, 83, 79, 75, 41, 91, 87, 95, 97, 93, 101, 103, 99, 107, 103, 99, 83, 91, 87, 71, 121, 117, 125, 121, 117, 131, 133
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Module[{p = 2, q},
      While[True, q = 2 n - p; If[PrimeQ[p] && PrimeQ[q], Break[]];
       p = NextPrime[p]]; q - 2 p], {n, 2, 100}]
  • PARI
    a(n) = my(q=precprime(2*n)); while (!isprime(2*n - q), q = precprime(q-1)); q - 2*(2*n-q); \\ Michel Marcus, Dec 12 2024
Showing 1-2 of 2 results.