login
Numbers whose sum of digits are congruent (mod 10) to the string 1,2, ..., 9.
1

%I #21 Oct 05 2017 14:35:14

%S 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,29,20,21,22,23,24,25,26,

%T 27,38,39,30,31,32,33,34,35,36,47,48,49,40,41,42,43,44,45,56,57,58,59,

%U 50,51,52,53,54,65,66,67,68,69,60,61,62,63,74,75,76,77,78,79,70,71,72,83

%N Numbers whose sum of digits are congruent (mod 10) to the string 1,2, ..., 9.

%C a(n) is the smallest term not yet in the sequences such that A007953(a(n)) == A010888(n) (mod 10). - _R. J. Mathar_, Oct 05 2017

%e The first string is 1,2,...,9; the second string goes from 10 to 18 since 1+0 is congruent to 1 (mod 10) and 1+8 is congruent to 9 (mod 10); the third string goes from 29 to 27 since 2+9 is congruent to 1 (mod 10) and 2+7 is congruent to 9 (mod 10), etc.

%p A285054 := proc(n)

%p option remember;

%p local a,i,known ;

%p if n = 1 then

%p 1;

%p else

%p for a from 2 do

%p known := false ;

%p for i from 1 to n-1 do

%p if procname(i) = a then

%p known := true;

%p break;

%p end if;

%p end do:

%p if not known then

%p if modp(digsum(a),10) = A010888(n) then

%p return a;

%p end if;

%p end if;

%p end do:

%p end if;

%p end proc:

%p seq(A285054(n),n=1..200) ; # _R. J. Mathar_, Oct 05 2017

%K nonn,base

%O 1,2

%A _Enrique Navarrete_, Sep 11 2017