%I #13 Apr 12 2023 14:44:19
%S 2,3,5,7,11,12,13,15,16,18,19,20,30,31,32,34,35,37,38,50,51,53,54,56,
%T 57,59,70,72,73,75,76,78,91,92,94,95,97,101,102,103,105,106,107,110,
%U 120,121,122,123,124,126,127,128,129,130,131,132,134,135,136,139
%N n such that d(1)*1! + d(2)*2! + ... + d(k)*k! is prime, where d(i) are the decimal digits of n.
%e 139 is in the sequence because 1*1! + 3*2! + 9*3! = 1 + 6 + 54 = 61 is prime.
%p for n from 1 to 140 do :l:=length(n):n0:=n:s:=0:for m from l by -1 to 1 do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+u*m!:od: if type(s,prime)=true then printf(`%d, `,n):else fi:od:
%t Select[Range[200],PrimeQ[Total[IntegerDigits[#]Range[IntegerLength[#]]!]]&] (* _Harvey P. Dale_, Apr 12 2023 *)
%o (PARI) is_A198096(n)=isprime(sum(k=1,#n=Vecsmall(Str(n)),(n[k]-48)*k!)) \\ _M. F. Hasler_, Jan 26 2012
%Y Cf. A198044.
%K nonn,base
%O 1,1
%A _Michel Lagneau_, Oct 21 2011