|
|
A169921
|
|
a(n) = n*n in the arithmetic where when digits are to be added they are multiplied, and when they are to be multiplied they are added.
|
|
3
|
|
|
0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 210, 242, 294, 366, 458, 620, 762, 924, 2906, 3018, 440, 492, 564, 656, 768, 960, 1122, 4904, 5016, 5128, 690, 762, 854, 966, 1098, 1320, 6902, 7014, 7126, 7238, 960, 1052, 1164, 1296, 1448, 8900, 9012, 9124, 9236, 9348
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
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 7 and 6 is "added", i.e. multiplied, there is a carry of 4, which here has been added to the 2 to get 6.
|
|
LINKS
|
|
|
EXAMPLE
|
a(15) = 15*15 = 620:
....15
....15
------
....70
...26.
------
...620
------
|
|
PROG
|
(Python)
from math import prod
n = len(str(m))+1
hold = [x for x in list(zip(*[list(str(sum((int(b)+int(d))*10**a for a, b in enumerate(reversed(str(m))))).ljust(c+n, "X").rjust(8, "X")) for c, d in enumerate(reversed(str(m)))])) if x != ('X', )*(n-1)]
store = [prod([int(b) for b in c if b.isdigit()])*10**a for a, c in enumerate(reversed(hold))]
return sum(store)
# David Consiglio, Oct 24 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|