cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A098837 Smith semiprimes.

This page as a plain text file.
%I A098837 #21 Mar 14 2025 09:50:23
%S A098837 4,22,58,85,94,121,166,202,265,274,319,346,355,382,391,454,517,526,
%T A098837 535,562,634,706,778,895,913,922,958,985,1111,1165,1219,1255,1282,
%U A098837 1507,1633,1642,1678,1795,1822,1858,1894,1903,1921,1966,2038,2155,2173,2182,2218
%N A098837 Smith semiprimes.
%H A098837 Charles R Greathouse IV, <a href="/A098837/b098837.txt">Table of n, a(n) for n = 1..10000</a>
%H A098837 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_4">Smith Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 4, 127-157.
%e A098837 a(3)=58 because 58 is a Smith number as well as a semiprime.
%p A098837 N:= 10000: # for terms <= N
%p A098837 P:= select(isprime, [2,seq(i,i=3..N/2,2)]):
%p A098837 nP:= nops(P):
%p A098837 sP:= map(p -> convert(convert(p,base,10),`+`), P):
%p A098837 Res:= {}:
%p A098837 for i from 1 to nP do
%p A098837   for j from i to nP do
%p A098837     n:= P[i]*P[j];
%p A098837     if n > N then break fi;
%p A098837     if convert(convert(n,base,10),`+`) = sP[i]+sP[j] then
%p A098837       Res:= Res union {n}
%p A098837     fi
%p A098837 od od:
%p A098837 sort(convert(Res,list)); # _Robert Israel_, Aug 24 2024
%t A098837 sspQ[n_]:=PrimeOmega[n]==2&&Total[Flatten[IntegerDigits/@(Table[#[[1]],#[[2]]]&/@FactorInteger[n])]]==Total[IntegerDigits[n]]; Select[Range[ 2220], sspQ] (* _Harvey P. Dale_, Jul 25 2019 *)
%o A098837 (PARI) dsum(n)=my(s);while(n,s+=n%10;n\=10);s
%o A098837 list(lim)=my(v=List(),d); forprime(p=2, sqrt(lim), d=dsum(p); forprime(q=p, lim\p, if(d+dsum(q)==dsum(p*q),listput(v, p*q)))); vecsort(Vec(v)) \\ _Charles R Greathouse IV_, Jan 03 2012
%Y A098837 Cf. A001358, A006753.
%K A098837 base,nonn
%O A098837 1,1
%A A098837 _Shyam Sunder Gupta_, Oct 10 2004