login
Numbers whose digits squared sum to a semiprime.
2

%I #19 May 30 2023 07:16:25

%S 2,3,5,7,13,15,18,19,20,29,30,31,34,35,37,43,47,50,51,53,57,59,67,70,

%T 73,74,75,76,81,89,91,92,95,98,103,105,108,109,112,116,117,121,122,

%U 123,124,128,129,130,132,134,135,136,138,139,142,143,144,150,153,155

%N Numbers whose digits squared sum to a semiprime.

%H Christian N. K. Anderson, <a href="/A217907/b217907.txt">Table of n, a(n) for n = 1..10000</a>

%e 135 is in the sequence because 1^2+3^2+5^2=35, and 35=7*5 is a semiprime.

%t Select[Range[200],PrimeOmega[Total[IntegerDigits[#]^2]]==2&] (* _Harvey P. Dale_, Nov 26 2022 *)

%o (R) sumodsq<-function(i) sum(as.numeric(strsplit(as.character(i),"")[[1]])^2)

%o sodsq.sp=c(); i=-1

%o while(length(sodsq.sp)<10000) if(sum(factorize(sumodsq((i=i+1)))[[1]][,2])==2) sodsq.sp=c(sodsq.sp,i)

%Y Cf. A085802, A001358.

%K nonn,base,easy

%O 1,1

%A _Kevin L. Schwartz_ and _Christian N. K. Anderson_, Mar 25 2013