A285719 a(1) = 1, and for n > 1, a(n) = the largest squarefree number k such that n-k is also squarefree.
1, 1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 11, 13, 14, 15, 15, 17, 17, 19, 19, 21, 22, 23, 23, 23, 26, 26, 26, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 39, 41, 42, 43, 43, 43, 46, 47, 47, 47, 46, 51, 51, 53, 53, 55, 55, 57, 58, 59, 59, 61, 62, 62, 62, 65, 66, 67, 67, 69, 70, 71, 71, 73, 74, 74, 74, 77, 78, 79, 79, 79, 82, 83, 83, 85, 86, 87, 87, 89, 89, 91, 91
Offset: 1
Keywords
Examples
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) = 46.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
- Mathematics Stack Exchange, Sums of square free numbers, is this conjecture equivalent to Goldbach's conjecture? (See especially the answer of Aryabhata)
- K. Rogers, The Schnirelmann density of the squarefree integers, Proc. Amer. Math. Soc. 15 (1964), pp. 515-516.
Programs
-
Mathematica
lsfn[n_]:=Module[{k=n-1},While[!SquareFreeQ[k]||!SquareFreeQ[n-k],k--];k]; Join[{1},Array[ lsfn,100,2]] (* Harvey P. Dale, Apr 27 2023 *)
-
Python
from sympy.ntheory.factor_ import core def issquarefree(n): return core(n) == n def a285718(n): if n==1: return 0 x = 1 while True: if issquarefree(x) and issquarefree(n - x):return x else: x+=1 def a285719(n): return n - a285718(n) print([a285719(n) for n in range(1, 121)]) # Indranil Ghosh, May 02 2017
-
Scheme
(define (A285719 n) (- n (A285718 n))) (define (A285719 n) (if (= 1 n) n (let loop ((k (A013928 n))) (if (not (zero? (A008683 (- n (A005117 k))))) (A005117 k) (loop (- k 1))))))
Formula
a(n) = n - A285718(n).
Comments