%I #28 Aug 09 2024 15:15:24
%S 1,2,3,4,5,7,9,11,13,17,19,23,25,29,31,37,41,43,47,49,53,59,61,67,71,
%T 73,79,83,89,97,101,103,107,109,113,121,127,131,137,139,149,151,157,
%U 163,167,169,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251
%N Numbers n such that d(n)<4.
%C 1 together with primes and squares of primes.
%C Numbers n such that A229964(n) = 0. - _Eric M. Schmidt_, Oct 05 2013
%C Numbers that cannot be written as a product of 2 distinct nonunits. - _Peter Munn_, May 26 2023
%H G. C. Greubel, <a href="/A166684/b166684.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A000430(n-1), n>1. - _R. J. Mathar_, May 21 2010
%t Select[Range[300],DivisorSigma[0,#]<4&] (* or *) Select[With[ {prs = Prime[Range[200]]},Union[Join[{1},prs,prs^2]]],#<301&] (* _Harvey P. Dale_, Jan 04 2012 *)
%o (PARI) is(n)=isprime(n) || (issquare(n,&n) && isprime(n)) || n==1 \\ _Charles R Greathouse IV_, Dec 23 2022
%o (Python)
%o from math import isqrt
%o from sympy import primepi
%o def A166684(n):
%o def f(x): return n-1+x-primepi(x)-primepi(isqrt(x))
%o m, k = n, f(n)
%o while m != k:
%o m, k = k, f(k)
%o return int(m) # _Chai Wah Wu_, Aug 09 2024
%Y A000430 is the main entry for this sequence.
%Y Cf. A000005, A229964.
%K nonn,easy
%O 1,2
%A _Juri-Stepan Gerasimov_, Oct 18 2009
%E Corrected (193 inserted) by _R. J. Mathar_, May 21 2010