A376270 a(n) is the product of the leading digit of n and the sum of the squares of its digits.
0, 1, 8, 27, 64, 125, 216, 343, 512, 729, 1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 8, 10, 16, 26, 40, 58, 80, 106, 136, 170, 27, 30, 39, 54, 75, 102, 135, 174, 219, 270, 64, 68, 80, 100, 128, 164, 208, 260, 320, 388, 125, 130, 145, 170, 205, 250, 305, 370, 445, 530, 216, 222, 240, 270, 312, 366
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- N. Bradley Fox et al., Elated Numbers, arXiv:2409.09863 [math.NT], 2024.
Programs
-
Maple
a:= n-> (l-> l[-1]*add(i^2, i=l))(convert(n, base, 10)): seq(a(n), n=0..65); # Alois P. Heinz, Sep 18 2024
-
Mathematica
a[n_]:=First[d=IntegerDigits[n]]Norm[d]^2; Array[a,66,0] (* Stefano Spezia, Sep 18 2024 *)
-
PARI
a(n) = if (n, my(d=digits(n)); d[1]*norml2(d), 0);
-
Python
def a(n): return (d:=list(map(int, str(n))))[0] * sum(di*di for di in d) print([a(n) for n in range(66)]) # Michael S. Branicky, Sep 18 2024