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.

A077685 Squarefree numbers beginning with 9.

Original entry on oeis.org

91, 93, 94, 95, 97, 901, 902, 903, 905, 906, 907, 910, 911, 913, 914, 915, 917, 919, 921, 922, 923, 926, 929, 930, 933, 934, 935, 937, 938, 939, 941, 942, 943, 946, 947, 949, 951, 953, 955, 957, 958, 959, 962, 965, 966, 967, 969, 970, 971, 973, 974, 977, 978
Offset: 1

Views

Author

Amarnath Murthy, Nov 16 2002

Keywords

Comments

Intersection of A005117 and A217402. - Michel Marcus, Sep 14 2013
Lower density is 1/(15*Pi^2), upper density is 2/(3*Pi^2). - Charles R Greathouse IV, Nov 05 2017

Crossrefs

Programs

  • Mathematica
    Select[Range[1000],SquareFreeQ[#]&&First[IntegerDigits[#]]==9&] (* Harvey P. Dale, Dec 15 2013 *)
  • PARI
    isok(n) = issquarefree(n) && (digits(n)[1] == 9); \\ Michel Marcus, Sep 14 2013
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A077685(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 g(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)))
        def h(x): return 0 if x<9 else h(10**(len(s:=str(x))-1)-1)+(g(x)-g(9*10**(len(s)-1)-1) if s[0]=='9' else 0)
        def f(x): return n+x-h(x)
        return bisection(f,n,n) # Chai Wah Wu, May 06 2025

Extensions

More terms from Sascha Kurz, Jan 28 2003