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.

A057627 Number of nonsquarefree numbers not exceeding n.

This page as a plain text file.
%I A057627 #55 May 11 2024 02:15:24
%S A057627 0,0,0,1,1,1,1,2,3,3,3,4,4,4,4,5,5,6,6,7,7,7,7,8,9,9,10,11,11,11,11,
%T A057627 12,12,12,12,13,13,13,13,14,14,14,14,15,16,16,16,17,18,19,19,20,20,21,
%U A057627 21,22,22,22,22,23,23,23,24,25,25,25,25,26,26,26,26,27,27,27,28,29,29,29
%N A057627 Number of nonsquarefree numbers not exceeding n.
%C A057627 Number of integers k in A013929 in the range 1 <= k <= n.
%C A057627 This sequence is different from A013940, albeit the first 35 terms are identical.
%C A057627 Asymptotic to k*n where k = 1 - 1/zeta(2) = 1 - 6/Pi^2 = A229099. - _Daniel Forgues_, Jan 28 2011
%C A057627 This sequence is the sequence of partial sums of A107078 (not of A056170). - _Jason Kimberley_, Feb 01 2017
%C A057627 Number of partitions of 2n into two parts with the smallest part nonsquarefree. - _Wesley Ivan Hurt_, Oct 25 2017
%H A057627 Robert Israel, <a href="/A057627/b057627.txt">Table of n, a(n) for n = 1..10000</a>
%F A057627 a(n) = n - A013928(n+1) = n - Sum_{k=1..n} mu(k)^2.
%F A057627 G.f.: Sum_{k>=1} (1 - mu(k)^2)*x^k/(1 - x). - _Ilya Gutkovskiy_, Apr 17 2017
%e A057627 a(36)=13 because 13 nonsquarefree numbers exist which do not exceed 36:{4,8,9,12,16,18,20,24,25,27,28,32,36}.
%p A057627 N:= 1000: # to get terms up to a(N)
%p A057627 B:= Array(1..N, numtheory:-issqrfree):
%p A057627 C:= map(`if`,B,0,1):
%p A057627 A:= map(round,Statistics:-CumulativeSum(C)):
%p A057627 seq(A[n],n=1..N); # _Robert Israel_, Jun 03 2014
%t A057627 Accumulate[Table[If[SquareFreeQ[n],0,1],{n,80}]] (* _Harvey P. Dale_, Jun 04 2014 *)
%o A057627 (Scheme) (define (A057627 n) (- n (A013928 (+ n 1))))
%o A057627 (PARI) a(n) = my(s=0); forsquarefree(k=1, sqrtint(n), s += (-1)^(#k[2]~) * (n\k[1]^2)); n - s; \\ _Charles R Greathouse IV_, May 18 2015; corrected by _Daniel Suteu_, May 11 2023
%o A057627 (Python)
%o A057627 from math import isqrt
%o A057627 from sympy import mobius
%o A057627 def A057627(n): return n-sum(mobius(k)*(n//k**2) for k in range(1,isqrt(n)+1)) # _Chai Wah Wu_, May 10 2024
%Y A057627 Cf. A005117, A008683, A013929, A013940, A013928, A002321, A028442, A107078, A229099, A294242.
%K A057627 nonn,easy
%O A057627 1,8
%A A057627 _Labos Elemer_, Oct 10 2000
%E A057627 Offset and formula corrected by _Antti Karttunen_, Jun 03 2014