login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A number n is included if (Sum_{k=1..n} d(k)) is divisible by d(n), where d(n) is the number of positive divisors of n.
2

%I #14 Oct 24 2023 02:16:18

%S 1,5,7,8,16,17,19,20,23,25,37,41,42,43,47,49,64,65,67,68,69,70,71,73,

%T 74,77,79,101,103,107,108,109,113,149,150,151,155,157,163,164,165,166,

%U 167,169,197,199,211,223,257,259,263,264,265,267,268,269,271,274,275,277

%N A number n is included if (Sum_{k=1..n} d(k)) is divisible by d(n), where d(n) is the number of positive divisors of n.

%C sum{k=1 to n} d(k) = sum{k=1 to n} floor(n/k) = A006218(n).

%H Michael De Vlieger, <a href="/A140237/b140237.txt">Table of n, a(n) for n = 1..10000</a>

%t s = 0; Reap[Do[If[Divisible[s += #, #], Sow[i]] &[DivisorSigma[0, i]], {i, 280}] ][[-1, 1]] (* _Michael De Vlieger_, Oct 23 2023 *)

%o (Python)

%o from math import isqrt

%o from sympy import divisor_count

%o def A140237_gen(startvalue=1): # generator of terms >= startvalue

%o return filter(lambda n: not (-(s:=isqrt(n))**2+(sum(n//k for k in range(1,s+1))<<1))%divisor_count(n),count(max(startvalue,1)))

%o A140237_list = list(islice(A140237_gen(),30)) # _Chai Wah Wu_, Oct 23 2023

%Y Cf. A000005, A006218, A140238.

%K nonn

%O 1,2

%A _Leroy Quet_, May 14 2008

%E Extended by _Ray Chandler_, Jun 25 2009