login
A240902
Consider a number of k digits n = d_(k)*10^(k-1) + d_(k-1)*10^(k-2) + … + d_(2)*10 + d_(1). Sequence lists the numbers n such that sigma(n)-n = Sum_{i=1..k-1}{sigma(Sum_{j=1..i}{d_(j)*10^(j-1)})} + Sum_{i=1..k-1}{sigma(Sum_{j=1..i}{d_(k-j+1)*10^(i-j)})} (see example below)
9
39, 147, 413, 1268, 1550, 3964, 9987, 137097, 238268, 285993, 2139783, 4866838, 74523325, 131135109
OFFSET
1,1
COMMENTS
a(15) > 10^10. - Giovanni Resta, May 23 2016
EXAMPLE
If n = 238268, starting from the least significant digit, let us cut the number into the set 8, 68, 268, 8268, 38268. We have:
sigma(8) = 15;
sigma(68) = 126;
sigma(268) = 476;
sigma(8268) = 21168;
sigma(38268) = 96824.
Then, starting from the most significant digit, let us cut the number into the set 2, 23, 238, 2382, 23826. We have:
sigma(2) = 3;
sigma(23) = 24;
sigma(238) = 432;
sigma(2382) = 4776;
sigma(23826) = 54864.
Finally, 15 + 126 + 476 + 21168 + 96824 + 3 + 24 + 432 + 4776 + 54864 = 178708 = sigma(238268) - 238268.
MAPLE
with(numtheory); P:=proc(q) local a, b, k, n;
for n from 2 to q do a:=0; k:=1; while trunc(n/10^k)>0 do
a:=a+sigma(trunc(n/10^k)); k:=k+1; od; b:=0; k:=1;
while (n mod 10^k)<n do b:=b+sigma(n mod 10^k); k:=k+1; od;
if sigma(n)-n=a+b then print(n); fi; od; end: P(10^9);
PROG
(PARI) isok(n) = {sa = 0; k = 1; while (x=n\10^k, sa += sigma(x); k++; ); sb = 0; k = 1; while ((x=n % 10^k) < n, if (x, sb += sigma(x)); k++; ); sigma(n)-n == sa+sb; } \\ Michel Marcus, Jun 19 2015
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Paolo P. Lava, Apr 16 2014
EXTENSIONS
a(11)-a(12) from Michel Marcus, Jun 19 2015
a(13)-a(14) from Giovanni Resta, May 23 2016
STATUS
approved