%I #35 Aug 20 2022 02:24:02
%S 0,1,1,1,2,1,1,1,2,3,1,1,2,1,1,1,2,1,2,1,2,1,1,1,2,3,1,2,3,1,1,1,2,1,
%T 1,1,2,1,1,1,2,1,1,1,2,3,1,1,2,3,5,1,2,1,2,1,2,1,1,1,2,1,1,2,3,1,1,1,
%U 2,1,1,1,2,1,1,2,3,1,1,1,2,3,1,1,2,1,1,1,2,1,2,1,2,1,1,1,2,1,2,3,6,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,3,1,1
%N a(1) = 0, and for n > 1, a(n) = the least squarefree number x such that n-x is also squarefree.
%C For any n > 1 there is at least one decomposition of n as a sum of two squarefree numbers (cf. A071068 and the Mathematics Stack Exchange link). Of all pairs (x,y) of positive squarefree numbers for which x <= y and x+y = n, sequences A285718 and A285719 give the unique pair for which the difference y-x is the largest possible.
%C Question: Are there arbitrarily large terms in this sequence?
%H Antti Karttunen, <a href="/A285718/b285718.txt">Table of n, a(n) for n = 1..10000</a>
%H Mathematics Stack Exchange, <a href="https://math.stackexchange.com/questions/20564/sums-of-square-free-numbers-is-this-conjecture-equivalent-to-goldbachs-conjec">Sums of square free numbers, is this conjecture equivalent to Goldbach's conjecture?</a> (See especially the answer of Aryabhata)
%H K. Rogers, <a href="http://dx.doi.org/10.1090/S0002-9939-1964-0163893-X">The Schnirelmann density of the squarefree integers</a>, Proc. Amer. Math. Soc. 15 (1964), pp. 515-516.
%F a(n) = n - A285719(n).
%e For n=51 we see that 50 (2*5*5), 49 (7*7) and 48 (2^4 * 3) are all nonsquarefree (A013929). 47 (a prime) is squarefree, but 51 - 47 = 4 is not. On the other hand, both 46 (2*23) and 5 are squarefree numbers, thus a(51) = 5.
%t Table[If[n == 1, 0, x = 1; While[Nand[SquareFreeQ@ x, SquareFreeQ[n - x]], x++]; x], {n, 120}] (* _Michael De Vlieger_, May 03 2017 *)
%o (Scheme)
%o (define (A285718 n) (if (= 1 n) 0 (let loop ((k 1)) (if (not (zero? (A008683 (- n (A005117 k))))) (A005117 k) (loop (+ 1 k))))))
%o (Python)
%o from sympy.ntheory.factor_ import core
%o def issquarefree(n): return core(n) == n
%o def a285718(n):
%o if n==1: return 0
%o x = 1
%o while True:
%o if issquarefree(x) and issquarefree(n - x):return x
%o else: x+=1
%o print([a285718(n) for n in range(1, 121)]) # _Indranil Ghosh_, May 02 2017
%Y Cf. A005117, A008683, A013929, A071068, A285719, A285720, A285734.
%K nonn
%O 1,5
%A _Antti Karttunen_, May 02 2017
|