[seqfan] Re: Sum of a(n) first digits of S is a(n+1)

Maximilian Hasler maximilian.hasler at gmail.com
Fri Jan 8 03:16:18 CET 2010


> We can weaken the condition  "the terms of A061384 which have the additional
> property of being a multiple of their sum-of-digits" to be "the terms k of A061384
> with d digits such that the first (k mod d) digits of k have digit sum equal to (k mod d)".
> Perhaps someone can easily prove that this is a sufficient condition for the constant
> solution [k,k,...] to be a solution to the original problem "Sum of a(n) first digits of A is a(n+1)".

yes, of course this is a sufficient condition.
In fact, if the sequence is constant, a(n)=k for all n,
then the definition is equivalent to
k = the sum of the first k digits.

Now, if k has d digits, then
the sum of the first k digits
= the sum of the digits of the first [k/d] terms (*)
 plus the sum of the first (k mod d) digits of k.
= [k/d] * sum_of_digits( k ) + sum of first (k mod d) digits of k.

(*)  [x] = floor(x)

This being equal to k, is equivalent to

k = [k/d] * sum_of_digits( k ) + (sum of first (k mod d) digits of k)

On the other hand we also have
k = [k/d]*d + (k mod d).

Now, if d = sum_of_digits( k ) (i.e., k in A061384),
then the first term on each side are the same,
and we have
(k mod d) = (sum of first (k mod d) digits of k)

as we wanted to show.

Without the assumption
d = sum_of_digits( k ) (i.e., k in A061384),
we have that k is a solution iff

[k/d] * (sum_of_digits( k ) - d)
 =  (k mod d) - (sum of first (k mod d) digits of k)

This quickly allows to check if a given k is a solution.
The following PARI script (where d are the digits, #d the number of
digits) uses this check:

is_sol(k,d)={k\#(d=eval(Vec(Str(k))))*(sum(i=1,#d,d[i])-#d)==k%#d-sum(i=1,k%#d,d[i])};

for(k=1,9999,is_sol(k) && print1(k", "))
1, 11, 20, 102, 111, 120, 201, 210, 300, 1012, 1021, 1102, 1111, 1120,
1201, 1300, 2002, 2011, 2020, 2200, 3100, 4000,

Maximilian




More information about the SeqFan mailing list