A077685 Squarefree numbers beginning with 9.
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
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
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
Comments