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.

A381333 Smallest integer that is the sum of a prime and the square of a prime in n or more ways.

Original entry on oeis.org

6, 11, 56, 176, 188, 362, 398, 668, 1448, 1448, 1592, 2390, 3372, 3632, 4532, 6342, 6342, 6368, 6368, 10632, 12920, 12920, 12942, 19502, 23168, 25038, 25038, 25038, 25472, 32238, 32238, 39800, 39800, 39800, 53360, 64998, 72740, 72740, 72740, 81542, 82880, 82880
Offset: 1

Views

Author

Chai Wah Wu, Feb 20 2025

Keywords

Comments

Subsequence of A081053. All terms are even except for a(2) = 11.

Examples

			a(1) = 6 as 6 = 2 + 2^2.
a(2) = 11 as 11 = 7 + 2^2 = 2 + 3^2.
a(3) = 56 as 56 = 47 + 3^2 = 31 + 5^2 = 7 + 7^2.
a(4) = 176 as 176 = 167 + 3^2 = 151 + 5^2 = 127 + 7^2 = 7 + 13^2.
a(5) = 188 as 188 = 179 + 3^2 = 163 + 5^2 = 139 + 7^2 = 67 + 11^2 = 19 + 13^2.
a(6) = 362 as 362 = 353 + 3^2 = 337 + 5^2 = 313 + 7^2 = 241 + 11^2 = 193 + 13^2 = 73 + 17^2.
		

Crossrefs

Programs

  • PARI
    f(k) = my(nb=0); forprime(p=2, sqrtint(k), if (isprime(k-p^2), nb++);); nb;
    a(n) = my(k=1); while (f(k) < n, k++); k; \\ Michel Marcus, Feb 21 2025
  • Python
    from itertools import count
    from math import isqrt
    from sympy import isprime, primerange
    def A381333(n):
        for m in count(1):
            c = 0
            for p in primerange(isqrt(m)+1):
                if isprime(m-p**2):
                    c += 1
                if c>=n:
                    return m