OFFSET
1,2
COMMENTS
Nonprime squarefree numbers.
Except for 1, composite n such that the squarefree part of n is greater than phi(n). - Benoit Cloitre, Apr 06 2002
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
N-floor(N/p1) - floor(N/(p2) - ... - floor(N/p(i) + floor(N/(c2) + floor(N/(c3)+ ... + floor(N/c(j)-1 where N is any number; p1,p2 are the primes with p(i) being the first prime > square root of N and c2, c3 are the numbers other than 1 in this sequence with c(j) <= N will yield the number of primes less than or equal to N other than p1, p2, ..., p(i). - Ben Paul Thurston, Aug 15 2007
Sum(n=1, Infinity, 1/a(n)^s) = Zeta(s)/Zeta(2s) - PrimeZeta(s). - Enrique Pérez Herrero, Mar 31 2012
a(n) = kn + O(n/log n) where k = Pi^2/6. - Charles R Greathouse IV, Aug 02 2024
MAPLE
select(numtheory:-issqrfree and not isprime, [$1..1000]); # Robert Israel, Aug 06 2015
MATHEMATICA
lst={}; Do[If[SquareFreeQ[n], If[ !PrimeQ[n], AppendTo[lst, n]]], {n, 200}]; lst (* Vladimir Joseph Stephan Orlovsky, Jan 20 2009 *)
With[{upto=200}, Complement[Select[Range[upto], SquareFreeQ], Prime[ Range[ PrimePi[ upto]]]]] (* Harvey P. Dale, Oct 01 2011 *)
Select[Range[200], !PrimeQ[#] && PrimeOmega[#] == PrimeNu[#] &] (* Carlos Eduardo Olivieri, Aug 06 2015 *)
PROG
(PARI) for(n=0, 64, if(isprime(n), n+1, if(issquarefree(n), print(n))))
(PARI) for(n=1, 160, if(core(n)*(1-isprime(n))>eulerphi(n), print1(n, ", ")))
(Haskell)
a000469 n = a000469_list !! (n-1)
a000469_list = filter ((== 0) . a010051) a005117_list
-- Reinhard Zumkeller, Mar 21 2014
(Python)
from math import isqrt
from sympy import primepi, mobius
def A000469(n):
def f(x): return n+primepi(x)+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m # Chai Wah Wu, Aug 02 2024
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
Dan Bentley (dtb(AT)research.att.com)
STATUS
approved