OFFSET
1,1
COMMENTS
Equivalently, a positive integer n is comfortably squarefree if and only if n^3 - n is squarefree. The 'if' direction is obvious from the factorization n(n-1)(n+1), and the converse follows from the coprimality of n, n - 1 and n + 1.
The asymptotic density of comfortably squarefree numbers is the product over all primes of 1 - 3/p^2, which is A206256 = 0.125486980905....
See also comments in A007675.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Dan Asimov, Interesting sequence on MathOverflow, Math-fun mailing list, Mar 28 2023.
Ewan Delanoy, Are there infinitely many triples of consecutive square-free integers?, Math Overflow.
A. P. Goucher, Comfortably squarefree numbers, Complex Projective 4-Space.
Fredrick M. Nelson, Does a(0)=6, a(n+1)=a(n)^3-a(n), define a square-free sequence?, MathOverflow, Mar 24 2023.
FORMULA
a(n) = A007675(n) + 1. - Giovanni Resta, Aug 29 2013
MAPLE
with(numtheory):
a := n -> `if`(issqrfree(n-1) and issqrfree(n) and issqrfree(n+1), n, NULL);
seq(a(n), n = 1..500); # Peter Luschny, Jan 18 2014
MATHEMATICA
Select[Range[500], (SquareFreeQ[# - 1] && SquareFreeQ[#] && SquareFreeQ[# + 1]) &] (* Adam P. Goucher *)
Select[Range[2, 500, 2], (MoebiusMu[# - 1] MoebiusMu[#] MoebiusMu[# + 1]) != 0 &] (* Alonso del Arte, Jan 16 2014 *)
Flatten[Position[Partition[Boole[SquareFreeQ/@Range[500]], 3, 1], {1, 1, 1}]]+1 (* Harvey P. Dale, Jan 14 2015 *)
SequencePosition[Table[If[SquareFreeQ[n], 1, 0], {n, 500}], {1, 1, 1}][[All, 1]]+1 (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 02 2018 *)
PROG
(PARI) is(n)=issquarefree(n-1)&&issquarefree(n)&&issquarefree(n+1) \\ Charles R Greathouse IV, Aug 29 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Adam P. Goucher, Aug 29 2013
STATUS
approved