cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A374736 a(n) is the least number of the form k*n for some k > 0 that can be added to n without carries in decimal.

This page as a plain text file.
%I A374736 #13 Jul 19 2024 18:38:38
%S A374736 0,1,2,3,4,10,12,21,40,90,10,11,12,13,14,30,32,51,180,380,20,21,22,23,
%T A374736 24,50,52,162,140,870,30,31,32,33,34,140,252,111,760,1560,40,41,42,43,
%U A374736 44,450,230,141,240,2450,100,102,104,106,324,110,112,342,1740
%N A374736 a(n) is the least number of the form k*n for some k > 0 that can be added to n without carries in decimal.
%H A374736 Rémy Sigrist, <a href="/A374736/b374736.txt">Table of n, a(n) for n = 0..10000</a>
%F A374736 a(n) = A374735(n) * n.
%F A374736 a(n) = n iff n belongs to A007091.
%F A374736 a(10*n) = 10*a(n).
%e A374736 For n = 8:
%e A374736 - 1*8 = 8; computing 8 + 8 requires a carry,
%e A374736 - 2*8 = 16; computing 8 + 16 requires a carry,
%e A374736 - 3*8 = 24; computing 8 + 24 requires a carry,
%e A374736 - 4*8 = 32; computing 8 + 32 requires a carry,
%e A374736 - 5*8 = 40; computing 8 + 40 does not require a carry,
%e A374736 - so a(8) = 40.
%o A374736 (PARI) a(n, base = 10) = { for (k = 1, oo, if (sumdigits((k+1)*n, base) == sumdigits(n, base) + sumdigits(k*n, base), return (k*n); ); ); }
%o A374736 (Python)
%o A374736 from itertools import count
%o A374736 def A374736(n):
%o A374736     s = list(map(int,str(n)[::-1]))
%o A374736     return next(k for k in count(n,n) if all(a+b<=9 for a, b in zip(s,map(int,str(k)[::-1])))) # _Chai Wah Wu_, Jul 19 2024
%Y A374736 Cf. A007091, A261892 (analog for binary), A353624 (analog for balanced ternary), A374735.
%K A374736 nonn,base,easy
%O A374736 0,3
%A A374736 _Rémy Sigrist_, Jul 18 2024