OFFSET
1,1
COMMENTS
The sequence is infinite because the powers of 4 (A000302) are in the sequence: the divisors of 2^(2m) are {1, 2, 4, 8, ..., 2^(2m)} and Sum_{i=1..q-1} d(i)/d(i+1) = 1/2 + 2/4 + 4/8 + ... + 2^(2m-1)/2^(2m) = 1/2 + 1/2 + ... + 1/2 = 2m.
The powers of 27 (A009971) are also in the sequence.
In the general case, the numbers of the form p^(p*m) where p is prime are in the sequence.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..55
EXAMPLE
54 is in the sequence because the divisors of 54 are {1, 2, 3, 6, 9, 18, 27, 54} and 1/2 + 2/3 + 3/6 + 6/9 + 9/18 + 18/27 + 27/54 = 4 is integer.
MAPLE
with(numtheory):for n from 1 to 2000000 do: x:=divisors(n):n1:=nops(x): s:=sum('x[i]/x[i+1]', 'i'=1..n1-1): if s=floor(s)then printf(`%d, `, n):else fi:od:
MATHEMATICA
fQ[n_] := Module[{d = Divisors[n]}, IntegerQ[Total[Most[d]/Rest[d]]]]; t = {}; n = 1; While[Length[t] < 40, n++; If[fQ[n], AppendTo[t, n]]]; t (* T. D. Noe, Aug 06 2013 *)
PROG
(PARI) is(n)=my(t, s); fordiv(n, d, s+=t/d; t=d); denominator(s)==1 && n>1 \\ Charles R Greathouse IV, Aug 06 2013
(Python)
from sympy import divisors
from fractions import Fraction
def ok(n):
if n < 2: return False
divs = divisors(n)
f = sum(Fraction(dn, dd) for dn, dd in zip(divs[:-1], divs[1:]))
return f.denominator == 1
print([k for k in range(70000) if ok(k)]) # Michael S. Branicky, Feb 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 06 2013
STATUS
approved