OFFSET
1,2
COMMENTS
The sums for the listed terms are 1, 2, 3, 5, 4, 6, 5, 7, 7, 7, 7, 7, 7, 7, 6, 8, 8, 8, 8, 8, 8, 8, 7, 14, 13, 12, 11, 10, 10, 11, 12, 10, ...
2612 is the only number where no i/d_i (or d_i/i) is ever equal to 1.
The b-file lists all the terms <= 10^10.
From 7352342 on, d_7 = 7.
There can't be any terms >= 10^10. For an m-digit number, if p is the largest prime <= m and p >= 11, by Bertrand's postulate the first sum has exactly one term with denominator p and can't be an integer. - Robert Israel, Aug 14 2015
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..798
EXAMPLE
For 2612 we have that 2/1 + 1/2 + 6/3 + 2/4 = 1/2 + 2/1 + 3/6 + 4/2 = 5;
For 358611 we have that 1/1 + 1/2 + 6/3 + 8/4 + 5/5 + 3/6 = 1/1 + 2/1 +3/6 + 4/8 + 5/5 + 6/3 = 7.
MAPLE
with(numtheory):P:=proc(q) local a, b, c, k, ok, n;
for n from 1 to q do a:=n; b:=0; c:=0; ok:=1;
for k from 1 to ilog10(n)+1 do if (a mod 10)=0 then ok:=0; break;
else b:=b+(a mod 10)/k; c:=c+k/(a mod 10); a:=trunc(a/10); fi; od;
if ok=1 then if b=c and type(b, integer) then print(n); fi; fi;
od; end: P(10^9);
MATHEMATICA
fQ[n_] := Block[{a, b, d = Reverse@ IntegerDigits@ n, k = IntegerLength@ n}, a = Sum[d[[i]]/i, {i, k}]; b = Sum[i/d[[i]], {i, k}]; And[a == b, IntegerQ@ a]]; Select[Select[Range@ 100000, Last@ DigitCount@ # == 0 &], fQ] (* Michael De Vlieger, Aug 06 2015 *)
PROG
(PARI) isok(n) = my(d = digits(n)); vecmin(d) && (sd = sum(k=1, #d, d[k]/(#d-k+1))) && (denominator(sd)==1) && (sd == sum(k=1, #d, k/d[#d-k+1])); \\ Michel Marcus, Aug 14 2015
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Paolo P. Lava, Jul 27 2015
STATUS
approved