%I #16 Jul 12 2021 03:01:31
%S 1,4,9,27,79,225,108,249,999,2104,1005,2235,1007,2108,1119,2169,1999,
%T 22132,10003,21213,11133,21004,10024,22334,10015,21035,11106,21226,
%U 10007,22127,10008,21228,11109,21039,10069,22389,19999,210002,111302,212112,100022
%N 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.
%e a(5) = 79 because 7*1! + 9*2! = 5^2.
%t 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 *)
%o (PARI) f(n) = my(d=digits(n)); sum(k=1, #d, d[k]*k!);
%o a(n) = my(k=1); while (f(k) != n^2, k++); k; \\ _Michel Marcus_, Jul 11 2021
%Y Subsequence of A198044.
%K nonn,base
%O 1,2
%A _Michel Lagneau_, Oct 21 2011
|