OFFSET
0,3
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Michel Marcus, Sep 18 2024
STATUS
approved