OFFSET
1,1
COMMENTS
The asymptotic density of this sequence is Product_{p prime} (1 - 2/p^2) - Product_{p prime} (1 - 3/p^2) = 0.197147118033435... (Mossinghoff et al., 2021). - Amiram Eldar, Nov 11 2021, Mar 21 2024
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
Michael J. Mossinghoff, Tomás Oliveira e Silva, and Tim Trudgian, The distribution of k-free numbers, Mathematics of Computation, Vol. 90, No. 328 (2021), pp. 907-929; arXiv preprint, arXiv:1912.04972 [math.NT], 2019-2020.
EXAMPLE
4 is in this sequence because 4 = 2^2 is nonsquarefree and both 4 - 1 = 3 and 4 + 1 = 5 are squarefree.
MATHEMATICA
Mean/@SequencePosition[Table[If[SquareFreeQ[n], 1, 0], {n, 400}], {1, 0, 1}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 19 2020 *)
PROG
(Magma) [n: n in [2..300] | not IsSquarefree(n) and IsSquarefree(n-1) and IsSquarefree(n+1)];
(PARI) isok(n) = !issquarefree(n) && issquarefree(n-1) && issquarefree(n+1); \\ Michel Marcus, Jun 18 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Jan 16 2017
EXTENSIONS
Definition corrected by Jon E. Schoenfield, Jun 18 2017
STATUS
approved