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.

A112929 Number of squarefree integers less than the n-th prime.

This page as a plain text file.
%I A112929 #40 Dec 12 2024 15:17:18
%S A112929 1,2,3,5,7,8,11,12,15,17,19,23,26,28,30,32,36,37,41,44,45,49,51,55,60,
%T A112929 61,63,66,67,70,77,80,83,85,91,92,95,99,102,104,108,109,116,117,120,
%U A112929 121,129,138,140,141,144,148,149,153,157,161,165,166,169,171,173,179,187
%N A112929 Number of squarefree integers less than the n-th prime.
%C A112929 a(n) = order of n-th term of A112925 among squarefree integers.
%H A112929 Diana Mecum and Charles R Greathouse IV, <a href="/A112929/b112929.txt">Table of n, a(n) for n = 1..10000</a> (first 200 terms from Mecum)
%F A112929 A005117(a(n)) = A112925(n). - _R. J. Mathar_, Apr 19 2008
%F A112929 a(n) = A013928(A000040(n)). - _Reinhard Zumkeller_, Apr 05 2010
%F A112929 a(n) ~ 6/Pi^2 * n log n. - _Charles R Greathouse IV_, Apr 26 2012
%e A112929 a(5)=7 because the 5th prime is 11 and the squarefree numbers not exceeding 11 are: 2,3,5,6,7,10,11.
%e A112929 The 5th term of A112925 is 10 and 10 is the 7th squarefree integer (with 1 counted as the first squarefree integer). So a(5) = 7.
%p A112929 with(numtheory): a:=proc(n) local p,B,j: p:=ithprime(n): B:={}: for j from 2 to p do if abs(mobius(j))>0 then B:=B union {j} else B:=B fi od: nops(B) end: seq(a(m),m=1..75);
%p A112929 # Or:
%p A112929 a := n -> nops(select(NumberTheory:-IsSquareFree, [seq(1..ithprime(n)-1)])):
%p A112929 seq(a(n), n=1..63);  # _Peter Luschny_, Dec 12 2024
%t A112929 f[n_] := Prime[n] - Sum[ If[ MoebiusMu[k]==0, 1, 0], {k, Prime[n]}] - 1; Table[ f[n], {n, 63}] (* _Robert G. Wilson v_, Oct 15 2005; syntax corrected by _Frank M Jackson_, Dec 28 2018 *)
%o A112929 (PARI) a(n)={
%o A112929 my(lim=prime(n)-1,b=sqrtint(lim\2));
%o A112929 sum(k=1,b,moebius(k)*(lim\k^2))+
%o A112929 sum(k=b+1,sqrt(lim),moebius(k))
%o A112929 }; \\ _Charles R Greathouse IV_, Apr 26 2012
%o A112929 (PARI) a(n,p=prime(n))=p--; my(s,b=sqrtint(p\2)); forsquarefree(k=1, b, s += p\k[1]^2*moebius(k)); forsquarefree(k=b+1, sqrtint(p), s += moebius(k)); s \\ _Charles R Greathouse IV_, Jan 08 2018
%o A112929 (Python)
%o A112929 from math import isqrt
%o A112929 from sympy import prime, mobius
%o A112929 def A112929(n): return (p:=prime(n))-1+sum(mobius(k)*(p//k**2) for k in range(2,isqrt(p)+1)) # _Chai Wah Wu_, Dec 12 2024
%Y A112929 Cf. A013928, A112925, A112926, A061400, A112928, A112930.
%K A112929 nonn
%O A112929 1,2
%A A112929 _Leroy Quet_, Oct 06 2005 and _Emeric Deutsch_, Oct 14 2005
%E A112929 More terms from _Diana L. Mecum_, May 29 2007
%E A112929 Edited by _N. J. A. Sloane_, Apr 26 2008 at the suggestion of _R. J. Mathar_