# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a169920 Showing 1-1 of 1 %I A169920 #16 Oct 21 2022 14:24:52 %S A169920 0,1,4,9,16,25,36,49,64,81,100,111,144,199,306,455,646,179,424,731, %T A169920 400,441,564,769,1126,505,606,829,1124,1481,900,991,12640,17190,1066, %U A169920 1355,1086,1259,1304,1651,1000,3440,6120,1749,2126,2605,2886,3569,3864,4841 %N A169920 a(n) = n*n in the arithmetic where digits are multiplied in base 10 (as usual) but when digits are to be added they are also multiplied in base 10. %C A169920 How should the carry digits be handled? In this version they have been handled by simply adding them in the old way, which is a bit worrisome. For example, in the calculation below, when the column containing 5 and 4 is "added", i.e. multiplied, there is a carry of 2, which here has been added to the 1 to get 3. %H A169920 David Consiglio, Jr., Table of n, a(n) for n = 0..10000 %e A169920 a(14) = 14*14 = 306: %e A169920 ....14 %e A169920 ....14 %e A169920 ------ %e A169920 ....56 %e A169920 ...14. %e A169920 ------ %e A169920 ...306 %e A169920 ------ %o A169920 (Python) %o A169920 from math import prod %o A169920 def A169920(m): %o A169920 n = len(str(m*m))+1 %o A169920 hold = list(zip(*[list(str(int(b)*m).ljust(n-1-a,"X").rjust(n-1,"X")) for a,b in enumerate(str(m))]))#List of products of long multiplication %o A169920 store = [] %o A169920 for a,c in enumerate(hold): %o A169920 if c.count('X') == len(c): %o A169920 store.append(0) %o A169920 else: %o A169920 store.append(prod([int(b) for b in c if b.isdigit()])*10**(len(hold)-a-1)) %o A169920 return(sum(store)) %o A169920 # _David Consiglio, Jr._, Oct 21 2022 %Y A169920 The four versions are A000290, A169919, A169920, A169921. %K A169920 nonn,base %O A169920 0,3 %A A169920 _David Applegate_, _Marc LeBrun_ and _N. J. A. Sloane_, Jul 20 2010 %E A169920 More terms from _David Consiglio, Jr._, Oct 21 2022 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE