OFFSET
1,6
COMMENTS
The difference between the number of ways of writing n = m + k and the number of ways of writing n = r*s, where m|k and r|s.
First occurrence of k beginning with k=-1: 1, 2, 8, 6, 12, 36, 24, 30, 72, 96, 60, 2097152, 216, 576, 120, 210, 1152, 240, 864, etc. - Robert G. Wilson v, Nov 28 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A056595(n) - 1. - Antti Karttunen, Oct 30 2017
a(n) = 0 iff n is a prime or a square of a prime, A000430. - Robert G. Wilson v, Nov 28 2017
Sum_{k=1..n} a(k) ~ n*log(n) + (2*gamma - zeta(2) - 2)*n, where gamma is Euler's constant (A001620). - Amiram Eldar, Dec 01 2023
EXAMPLE
a(6) = 2 because 2 is difference of number of ways of writing n = 1 + 5 = 2 + 4 = 3 + 3 where 1|5, 2|4, 3|3 and number of ways of writing n = 1*6 where 1|6.
MATHEMATICA
f[n_] := Block[{d = Divisors@ n}, Length@ d - Length[ Select[ d, IntegerQ@ Sqrt@# &]] - 1];; Array[f, 105] (* Robert G. Wilson v, Nov 28 2017 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Juri-Stepan Gerasimov, Oct 14 2017
STATUS
approved