login
Greatest k such that A002805(k) is not divisible by n, or a(n) = 0 if there's no such k.
2

%I #26 Feb 17 2020 07:18:45

%S 0,1,68,3,124,68,719102,7,206,124,11130347490407364042652446389727,68,

%T 2196,719102,124,15,4912,206,16128612858,124,719102,

%U 11130347490407364042652446389727,12166,68,624,2196,620,719102,20171036,124,27488495831,31,11130347490407364042652446389727

%N Greatest k such that A002805(k) is not divisible by n, or a(n) = 0 if there's no such k.

%C 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.

%C For k > a(n) > 0, A002805(k) is always divisible by n.

%C 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.

%C 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.)

%H Jinyuan Wang, <a href="/A329061/a329061_2.txt">PARI program and examples for n <= 10</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HarmonicNumber.html">Harmonic Number</a>

%F 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).

%F 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.

%F a(prime(i)) = (A177734(i)+1)*prime(i) - 1, where prime(i) = A000040(i). - _Jinyuan Wang_, Feb 06 2020

%e 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.

%Y Cf. A001008, A002805, A177734, A329293.

%K nonn

%O 1,3

%A _Jinyuan Wang_, Dec 07 2019

%E More terms from _Jinyuan Wang_, Feb 06 2020