OFFSET
1,3
COMMENTS
There are two cases where a(n) = 0: (a) n divides A002805(k) for all k, which only happens for n = 1; (b) there are infinitely many k such that n does not divide A002805(k), which may happen for some primes p and their multiples.
For k > a(n) > 0, A002805(k) is always divisible by n.
For prime p and k >= p, A002805(k) = (the denominator of s + (Sum_{i=1..floor(k/p)} 1/i)/p) is not divisible by p if and only if p divides A001008(floor(k/p)) = (the numerator of Sum_{i=1..floor(k/p)} 1/i), because the denominator of s = Sum_{1 <= i <= k, i is not divisible by p} 1/i can never be divisible by p.
If k == -1 or 0 (mod p), then p divides A001008(k) iff p^2 divides A001008(floor(k/p)), otherwise p divides A001008(k) iff p divides the numerator of (Sum_{i=floor(k/p)*p+1..k} 1/i) + (Sum_{i=1..floor(k/p)} 1/i)/p, where p is an odd prime and k >= p. (Since Sum_{i=1..p-1} (p-1)!/i = (-1)^((p-1)/2)*((p-1)/2)!*(Sum_{i=1..(p-1)/2} ((p-1)/2)!/i) + ((p-1)/2)!*(Sum_{i=1..(p-1)/2} (-1)^((p-1)/2)*((p-1)/2)!/(-i)) == 0 (mod p), odd prime p divides the numerator of Sum_{1 <= i <= floor(k/p)*p, i is not divisible by p} 1/i.)
LINKS
Jinyuan Wang, PARI program and examples for n <= 10
Eric Weisstein's World of Mathematics, Harmonic Number
FORMULA
If n = Product_{j=1..i} p_j^e_j, p_1 < ... < p_i are primes and a(p_j^e_j) > 0, then a(n) = Max_{j=1..i} a(p_j^e_j).
a(p^e) = p^(e-1)*(a(p)+1) - 1 for prime p and a(p) > 0. Proof: A001008(k)/A002805(k) = (Sum_{1 <= i <= k, i is not divisible by p^e} 1/i) + (Sum_{i=1..floor(k/p^e)} 1/i)/p^e), hence A002805(k) is not divisible by p^e if and only if p divides A001008(floor(k/p^e)). From the comment, we know that (a(p)+1)/p - 1 is the greatest m such that p divides A001008(m). Therefore, a(p^e) = p^e*((a(p)+1)/p-1) + p^e - 1 = p^(e-1)*(a(p)+1) - 1.
EXAMPLE
For p = 3, 3 divides numerator(1+1/2), so 2*3, 2*3 + 1 and 2*3 + 2 are such k that A002805(k) can't be divisible by 3. Similarly, 7*3, 7*3 + 1 and 7*3 + 2 are such k. Mod(A001008(7), 3) > 0 and Mod(numerator(1/22 + (Sum_{i=1..7} 1/i)/3), 3) = 0, hence 3 divides A001008(22), which means 22*3, 22*3 + 1 and 22*3 + 2 are also such k. a(3) = 68 because A001008(k) can never be divisible by 3 for k = 66, 67 and 68.
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Dec 07 2019
EXTENSIONS
More terms from Jinyuan Wang, Feb 06 2020
STATUS
approved