A352598 a(n) is the product of the squares of the nonzero digits of n.
1, 4, 9, 16, 25, 36, 49, 64, 81, 1, 1, 4, 9, 16, 25, 36, 49, 64, 81, 4, 4, 16, 36, 64, 100, 144, 196, 256, 324, 9, 9, 36, 81, 144, 225, 324, 441, 576, 729, 16, 16, 64, 144, 256, 400, 576, 784, 1024, 1296, 25, 25, 100, 225, 400, 625, 900, 1225, 1600, 2025, 36, 36, 144, 324
Offset: 1
Programs
-
Mathematica
a[n_] := (Times @@ Select[IntegerDigits[n], # > 1 &])^2; Array[a, 65] (* Amiram Eldar, Mar 22 2022 *)
-
PARI
a(n) = vecprod(apply(x->x^2, select(x->(x>1), digits(n))));
-
Python
from math import prod def a(n): return prod(int(d)**2 for d in str(n) if d != '0') print([a(n) for n in range(1, 64)]) # Michael S. Branicky, Mar 22 2022
-
Python
from math import prod def A352598(n): return prod(map(lambda x:(0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[int(x)],filter(lambda x:x>'1',str(n)))) # Chai Wah Wu, Sep 17 2024
Formula
a(n) = A051801(n)^2.
a(10*n) = a(n). - Bernard Schott, Mar 24 2022
Comments