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.

A233998 Values of n such that numbers of the form x^2+n*y^2 for some integers x, y cannot have prime factor of 5 raised to an odd power.

Original entry on oeis.org

2, 3, 7, 8, 12, 13, 17, 18, 22, 23, 27, 28, 32, 33, 37, 38, 42, 43, 47, 48, 50, 52, 53, 57, 58, 62, 63, 67, 68, 72, 73, 75, 77, 78, 82, 83, 87, 88, 92, 93, 97, 98, 102, 103, 107, 108, 112, 113, 117, 118, 122, 123, 127, 128, 132, 133, 137, 138, 142, 143, 147, 148, 152, 153, 157, 158
Offset: 1

Views

Author

V. Raman, Dec 18 2013

Keywords

Comments

Equivalently, this sequence is the union of numbers of the form 25^n*(5*n+2) and numbers of the form 25^n*(5*n+3).

Crossrefs

Programs

  • PARI
    is(n)=n/=25^valuation(n, 25); n%5==2||n%5==3 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • Python
    from sympy import integer_log
    def A233998(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-sum(((m:=x//25**i)-2)//5+(m-3)//5+2 for i in range(integer_log(x,25)[0]+1))
        return bisection(f,n,n) # Chai Wah Wu, Mar 19 2025

Formula

a(n) = 2.4 n + O(log n). - Charles R Greathouse IV, Dec 19 2013