OFFSET
1,2
COMMENTS
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..100 (terms for n = 1..66 from Chai Wah Wu)
EXAMPLE
For n = 5; digital sum of sigma(13) = digital sum of 14 = 5. The number 13 is the smallest number with this property so a(5) = 13.
MAPLE
N := 10^6: # return all values before the first > N
for n from 1 to N do
v:= convert(convert(numtheory:-sigma(n), base, 10), `+`);
if not assigned(A[v]) then A[v]:= n fi;
od:
for count from 1 while assigned(A[count]) do od:
seq(A[i], i=1..count-1); # Robert Israel, Apr 09 2015
MATHEMATICA
f[n_] := Block[{k = 1}, While[Plus @@ IntegerDigits[DivisorSigma[1, k]] != n, k++]; k]; Array[f, 48] (* Michael De Vlieger, Apr 07 2015 *)
PROG
(Magma) A256635:=func<n|exists(r){k:k in[1..10000000] | &+Intseq(SumOfDivisors(k)) eq n }select r else 0>; [A256635(n):n in[1..50]]
(PARI) a(n) = {my(k = 1); while(sumdigits(sigma(k)) != n, k++); k; } \\ Michel Marcus, Apr 09 2015
(Python)
from sympy.ntheory.factor_ import divisor_sigma
def A256635(n):
....k = 1
....while sum(int(d) for d in str(divisor_sigma(k))) != n:
........k += 1
....return k # Chai Wah Wu, Apr 18 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Apr 06 2015
STATUS
approved