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.
%I A077677 #28 Jul 27 2025 08:56:45 %S A077677 1,10,11,13,14,15,17,19,101,102,103,105,106,107,109,110,111,113,114, %T A077677 115,118,119,122,123,127,129,130,131,133,134,137,138,139,141,142,143, %U A077677 145,146,149,151,154,155,157,158,159,161,163,165,166,167,170,173,174,177 %N A077677 Squarefree numbers beginning with 1. %C A077677 Intersection of A005117 and A131835. - _Michel Marcus_, Sep 14 2013 %C A077677 Lower density is 3/(5*Pi^2), upper density is 10/(3*Pi^2). - _Charles R Greathouse IV_, Nov 05 2017 %H A077677 Amiram Eldar, <a href="/A077677/b077677.txt">Table of n, a(n) for n = 1..10000</a> %t A077677 Select[Range[177], First[IntegerDigits[#]]==1 && SquareFreeQ[#] &] (* _Jayanta Basu_, May 23 2013 *) %o A077677 (PARI) is(n)=n>0 && digits(n)[1]==1 && issquarefree(n) \\ _Charles R Greathouse IV_, Nov 05 2017 %o A077677 (PARI) list(lim)=my(v=List([1])); for(d=1,#Str(lim\=1)-1, my(D=10^d); forsquarefree(n=D,min(2*D,lim), listput(v,n[1]))); Vec(v) \\ _Charles R Greathouse IV_, Jan 10 2023 %o A077677 (Python) %o A077677 from math import isqrt %o A077677 from sympy import mobius %o A077677 def A077677(n): %o A077677 def bisection(f,kmin=0,kmax=1): %o A077677 while f(kmax) > kmax: kmax <<= 1 %o A077677 kmin = kmax >> 1 %o A077677 while kmax-kmin > 1: %o A077677 kmid = kmax+kmin>>1 %o A077677 if f(kmid) <= kmid: %o A077677 kmax = kmid %o A077677 else: %o A077677 kmin = kmid %o A077677 return kmax %o A077677 def g(x): return int(sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))) %o A077677 def h(x): return 0 if x<1 else h(2*10**((l:=len(s:=str(x)))-2)-1)-g((m:=10**(l-1))-1)+(g(x) if s[0]=='1' else g((m<<1)-1)) %o A077677 def f(x): return n+x-h(x) %o A077677 return bisection(f,n,n) # _Chai Wah Wu_, May 06 2025 %Y A077677 Cf. A077678, A077679, A077680, A077681, A077682, A077683, A077684, A077685. %K A077677 base,easy,nonn %O A077677 1,2 %A A077677 _Amarnath Murthy_, Nov 16 2002 %E A077677 Corrected and extended by _Sascha Kurz_, Jan 28 2003