login
A198095
a(n) is the smallest number k such that d(1)*1! + d(2)*2! + ... + d(p)*p! = n^2, where d(i) are the decimal digits of k.
1
1, 4, 9, 27, 79, 225, 108, 249, 999, 2104, 1005, 2235, 1007, 2108, 1119, 2169, 1999, 22132, 10003, 21213, 11133, 21004, 10024, 22334, 10015, 21035, 11106, 21226, 10007, 22127, 10008, 21228, 11109, 21039, 10069, 22389, 19999, 210002, 111302, 212112, 100022
OFFSET
1,2
EXAMPLE
a(5) = 79 because 7*1! + 9*2! = 5^2.
MATHEMATICA
Table[k = 1; While[d = IntegerDigits[k]; s = Sum[d[[i]] i!, {i, Length[d]}]; s != n^2, k++]; k, {n, 42}] (* after T. D. Noe, see A198044 *)
PROG
(PARI) f(n) = my(d=digits(n)); sum(k=1, #d, d[k]*k!);
a(n) = my(k=1); while (f(k) != n^2, k++); k; \\ Michel Marcus, Jul 11 2021
CROSSREFS
Subsequence of A198044.
Sequence in context: A111962 A307528 A365609 * A256096 A071913 A007872
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, Oct 21 2011
STATUS
approved