%I #35 Jul 23 2023 18:24:00
%S 29,76,157,174,191,475,713,1129,1961,3286,4424,7812,8973,19978,24317,
%T 35845,37041,51712,68022,166838,443275,444247,445219,509439,706317,
%U 1189312,1933197,2686010,10809303,55558901,58338037,257990335,504050156,839186880
%N Consider the 10's complements mod 10 of the digits of a number k. Take their sum and repeat the process deleting the first addend and adding the previous sum. The sequence lists the numbers that after some iterations reach a sum equal to k.
%C Like Keith numbers but using the ten's complements of their digits.
%C a(35) > 10^9. - _Robert Price_, Apr 08 2019
%e For 29, the 10's complements of its digits are 8, 1. Then:
%e 8 + 1 = 9;
%e 1 + 9 = 10;
%e 9 + 10 = 19;
%e 10 + 19 = 29.
%e For 475, the 10's complements of its digits are 6, 3, 5. Then:
%e 6 + 3 + 5 = 14;
%e 3 + 5 + 14 = 22;
%e 5 + 14 + 22 = 41;
%e 14 + 22 + 41 = 77;
%e 22 + 41 + 77 = 140;
%e 41 + 77 + 140 = 258;
%e 77 + 140 + 258 = 475.
%p with(numtheory): P:=proc(q,h) local a,b,c,k,n,t,v; v:=array(1..h);
%p for n from 10 to q do b:=ilog10(n)+1; c:=n; a:=[];
%p for k from 1 to b do a:=[(10-c) mod 10,op(a)]; c:=trunc(c/10); od;
%p for k from 1 to b do v[k]:=a[k]; od; t:=b+1; v[t]:=add(v[k], k=1..b);
%p while v[t]<n do t:=t+1; v[t]:=add(v[k], k=t-b..t-1); od;
%p if v[t]=n then print(n); fi; od; end: P(10^9,1000);
%t Select[Range[10^5], Function[{m, n}, Last@ NestWhile[Append[#, Total@ Take[#, -m]] &, Flatten[{#, Total@ #}] &[IntegerDigits[n] /. d_?Positive :> 10 - d], Last@ # < n &, 1, 10^2] == n] @@ {IntegerLength@#, #} &] (* _Michael De Vlieger_, Mar 09 2018 *)
%Y Cf. A007629.
%K nonn,base
%O 1,1
%A _Paolo P. Lava_, Oct 20 2015
%E Name clarified, some terms and Maple code corrected by _Paolo P. Lava_, Mar 08 2018
%E a(30)-a(32) from _Robert Price_, Apr 05 2019
%E a(33)-a(34) from _Robert Price_, Apr 08 2019
|