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.

A249370 Numbers p*m^2, where p is an odd prime and m >= 1, arranged in increasing order.

Original entry on oeis.org

3, 5, 7, 11, 12, 13, 17, 19, 20, 23, 27, 28, 29, 31, 37, 41, 43, 44, 45, 47, 48, 52, 53, 59, 61, 63, 67, 68, 71, 73, 75, 76, 79, 80, 83, 89, 92, 97, 99, 101, 103, 107, 108, 109, 112, 113, 116, 117, 124, 125, 127, 131, 137, 139, 147, 148, 149, 151, 153, 157
Offset: 1

Views

Author

Clark Kimberling, Oct 26 2014

Keywords

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    {seq(seq(p*m^2, m = 1 .. floor(sqrt(N/p))), p = select(isprime,[2*i+1 $ i = 1..floor((N-1)/2)]))};
    # if using Maple 11 or previous, uncomment the next line
    # sort(convert(%,list));
    # Robert Israel, Oct 30 2014
  • Mathematica
    Take[Sort[Flatten[Table[Prime[n]*m^2, {n, 2, 1000}, {m, 1, 100}]]], 100]
  • Python
    from math import isqrt
    from sympy import primepi
    def A249370(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x+(m:=isqrt(x))-sum(((k:=x//y**2)<2)+primepi(k) for y in range(1,m+1))
        return bisection(f,n,n) # Chai Wah Wu, Jan 30 2025