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.

A381330 Numbers that are the sum of a prime and the square of a prime in more than one way.

Original entry on oeis.org

11, 27, 28, 32, 38, 51, 52, 54, 56, 62, 66, 68, 72, 78, 80, 86, 92, 96, 98, 108, 110, 116, 122, 126, 128, 132, 134, 138, 140, 146, 150, 152, 156, 158, 162, 164, 171, 172, 174, 176, 180, 182, 186, 188, 192, 198, 200, 204, 206, 210, 212, 216, 218, 222, 224, 228
Offset: 1

Views

Author

Chai Wah Wu, Feb 20 2025

Keywords

Comments

Subsequence of A081053. Most terms are even. The odd terms are 11, 27, 51, 171, 363, 843, 1371, 1851 and must be of the form 2+p^2=4+q for primes p, q. In particular, the odd terms are exactly A049002(n)+4 for n>1.

Examples

			11 is a term since 11 = 2^2+7  = 3^2+2.
27 is a term since 27 = 2^2+23 = 5^2+2.
28 is a term since 28 = 3^2+19 = 5^2+3.
32 is a term since 32 = 3^2+23 = 5^2+7.
		

Crossrefs

Programs

  • PARI
    isok(k) = my(nb=0); forprime(p=2, sqrtint(k), if (isprime(k-p^2), nb++);); nb > 1; \\ Michel Marcus, Feb 21 2025
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy import isprime, primerange
    def A381330_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            c = 0
            for p in primerange(isqrt(n)+1):
                if isprime(n-p**2):
                    c += 1
                if c>1:
                    yield n
                    break
    A381330_list = list(islice(A381330_gen(),30))