login
Let s the sum of the decimal digit of a number k. Number of integer solutions of the equation s*(s+n)- k = 0.
1

%I #10 May 30 2014 04:25:49

%S 4,1,3,6,3,3,4,4,4,4,3,2,3,3,3,5,2,3,4,4,2,2,3,3,4,3,3,5,3,3,6,1,1,5,

%T 2,3,4,2,3,3,3,1,3,1,1,2,5,2,4,2,3,0,3,3,3,1,1,6,4,1,2,1,3,6,2,1,2,2,

%U 3,3,2,2,2,2,2,3,2,2,3,3,3,2,1,2,2,1,2,4,1,1,4,3,2,3,2,3,4,2,2,3,0,0,4,3,3,4,1,3,4,3,1,2,1,4

%N Let s the sum of the decimal digit of a number k. Number of integer solutions of the equation s*(s+n)- k = 0.

%C The equation s*(s+n)-k = 0 has no integer solution for n = {52, 101, 102, 152, 206, 393, 408, 464, 473, 482,...} (See the proof with the sequence A190216).

%H Robert Israel, <a href="/A190479/b190479.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 4 because k = {12, 42, 90, 156} and :

%e for k = 12, s = 3 and 3*(3+1) - 12 = 0 ;

%e for k = 42, s = 6 and 6*(6+1) - 42 = 0 ;

%e for k = 90, s = 9 and 9*(9+1) - 90 = 0 ;

%e for k = 156, s = 12 and 12*(12+1) - 156 = 0.

%p with(numtheory):for n from 1 to 500 do:s1:=0:for k from 1 to 30000 do l:=length(k):n0:=k:s:=0:for m from 1 to l do q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v:s:=s+u:od: if s*(s+n)=k then s1:=s1+1:else fi:od: printf(`%d, `, s1):od:

%p # Alternative:

%p N:= 500: # to get N terms

%p K:= ceil(fsolve(k/(9*log[10](k)) - 9*log[10](k) = N, k = 100 .. infinity)):

%p sd:= k -> convert(convert(k,base,10),`+`):

%p A:= Vector(N):

%p for k from 1 to K do

%p sk:= sd(k);

%p n:= k/sk - sk;

%p if type(n,posint) and n <= N then

%p A[n]:= A[n]+1

%p fi

%p od:

%p seq(A[n],n=1..N); # _Robert Israel_, May 30 2014

%Y Cf. A190216.

%K nonn,base

%O 1,1

%A _Michel Lagneau_, May 11 2011