login
A362864
Numbers k that divide Sum_{i=1..k} (i - d(i)), where d(n) is the number of divisors of n (A000005).
1
1, 2, 5, 8, 15, 24, 26, 47, 121, 204, 347, 562, 4204, 6937, 6947, 31108, 379097, 379131, 379133, 2801205, 12554202, 20698345, 56264197, 13767391064, 37423648626, 37423648726, 61701166395, 276525443156, 276525443176, 455913379395, 455913379831, 751674084802
OFFSET
1,2
COMMENTS
Numbers k such that the mean number of nondivisors in the range 1..k is an integer.
Numbers k such that A161664(k) is divisible by k.
Numbers k such that (A000217(k) - A006218(k)) is divisible by k.
The subsequence of odd terms k equals the intersection of A050226 and this sequence.
LINKS
EXAMPLE
k = 5: Sum_{i=1..5} (i - d(i))/k = 5/5 = 1, so k = 5 is a term.
MATHEMATICA
seq[kmax_] := Module[{sum = 0, s = {}}, Do[sum += k - DivisorSigma[0, k]; If[Divisible[sum, k], AppendTo[s, k]], {k, 1, kmax}]; s]; seq[10^6] (* Amiram Eldar, May 06 2023 *)
PROG
(PARI) isok(k) = !(sum(i=1, k, i - numdiv(i)) % k); \\ Michel Marcus, May 06 2023
(Python)
from itertools import count, islice
from sympy import divisor_count
def A362864_gen(): # generator of terms
c = 0
for k in count(1):
if not (c:=c+k-divisor_count(k))%k:
yield k
A362864_list = list(islice(A362864_gen(), 15)) # Chai Wah Wu, May 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 06 2023
EXTENSIONS
More terms from Amiram Eldar, May 06 2023
a(24)-a(32) from Martin Ehrenstein, May 22 2023
STATUS
approved