[go: up one dir, main page]

login
Search: a169919 -id:a169919
     Sort: relevance | references | number | modified | created      Format: long | short | data
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.
+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
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.
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from David Consiglio, Jr., Oct 21 2022
STATUS
approved
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.
+10
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
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
David Consiglio, Jr., Table of n, a(n) for n = 0..10000
EXAMPLE
a(15) = 15*15 = 620:
....15
....15
------
....70
...26.
------
...620
------
PROG
(Python)
from math import prod
def A169921(m):
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
The four versions are A000290, A169919, A169920, A169921.
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
More terms from David Consiglio, Jr., Oct 24 2022
STATUS
approved

Search completed in 0.004 seconds