login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 111, 144, 199, 306, 455, 646, 179, 424, 731, 400, 441, 564, 769, 1126, 505, 606, 829, 1124, 1481, 900, 991, 12640, 17190, 1066, 1355, 1086, 1259, 1304, 1651, 1000, 3440, 6120, 1749, 2126, 2605, 2886, 3569, 3864, 4841 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
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.
LINKS
David Consiglio, Jr., Table of n, a(n) for n = 0..10000
EXAMPLE
a(14) = 14*14 = 306:
....14
....14
------
....56
...14.
------
...306
------
PROG
(Python)
from math import prod
def A169920(m):
n = len(str(m*m))+1
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
store = []
for a, c in enumerate(hold):
if c.count('X') == len(c):
store.append(0)
else:
store.append(prod([int(b) for b in c if b.isdigit()])*10**(len(hold)-a-1))
return(sum(store))
# David Consiglio, Jr., Oct 21 2022
CROSSREFS
The four versions are A000290, A169919, A169920, A169921.
Sequence in context: A292679 A357632 A106545 * A093837 A194148 A162497
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from David Consiglio, Jr., Oct 21 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 21 09:16 EDT 2024. Contains 374472 sequences. (Running on oeis4.)