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.

A086697 Left-truncatable semiprimes, i.e., semiprimes in which repeatedly deleting the leftmost digit gives a semiprime at every step until a single-digit semiprime remains.

This page as a plain text file.
%I A086697 #25 Aug 05 2022 07:46:12
%S A086697 4,6,9,14,26,34,39,46,49,69,74,86,94,134,146,169,194,214,226,249,274,
%T A086697 314,326,334,339,346,386,394,446,469,514,526,586,614,626,634,649,669,
%U A086697 674,694,734,746,749,794,849,869,886,914,926,934,939,949,974,1169,1214
%N A086697 Left-truncatable semiprimes, i.e., semiprimes in which repeatedly deleting the leftmost digit gives a semiprime at every step until a single-digit semiprime remains.
%C A086697 Zero digits are not permitted, so 106 is not a member even though 106 and 6 are both semiprimes. - _Harvey P. Dale_, Jun 28 2017
%H A086697 Michael S. Branicky, <a href="/A086697/b086697.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Harvey P. Dale)
%H A086697 I. O. Angell and H. J. Godwin, <a href="http://dx.doi.org/10.1090/S0025-5718-1977-0427213-2">On Truncatable Primes</a>, Math. Comput. 31, 265-267, 1977.
%H A086697 <a href="/index/Tri#tprime">Index entries for sequences related to truncatable primes</a>
%e A086697 a(15)=146 is a term because 146, 46, 6 are all semiprimes.
%t A086697 ltsQ[n_]:=DigitCount[n,10,0]==0&&AllTrue[FromDigits/@NestList[Rest[ #]&, IntegerDigits[n],IntegerLength[n]-1],PrimeOmega[#]==2&]; Select[ Range[ 1500],ltsQ] (* _Harvey P. Dale_, Jun 28 2017 *)
%t A086697 lt3pQ[n_]:=Module[{idn=IntegerDigits[n]}, FreeQ[idn, 0]&&Union[PrimeOmega/@(FromDigits/@Table[Take[idn, -i], {i, Length[idn]}])]=={2}]; Select[Range[8000], lt3pQ] (* _Vincenzo Librandi_, Apr 22 2018 *)
%o A086697 (Python)
%o A086697 from sympy import factorint
%o A086697 from itertools import islice
%o A086697 def issemiprime(n): return sum(factorint(n).values()) == 2
%o A086697 def agen():
%o A086697     semis, digits = [4, 6, 9], "123456789" # can't have 0
%o A086697     while len(semis) > 0:
%o A086697         yield from semis
%o A086697         cands = set(int(d+str(p)) for p in semis for d in digits)
%o A086697         semis = sorted(c for c in cands if issemiprime(c))
%o A086697 print(list(islice(agen(), 55))) # _Michael S. Branicky_, Aug 04 2022
%Y A086697 Cf. A001358 (semiprimes), A085733 (right-truncatable).
%K A086697 base,nonn
%O A086697 1,1
%A A086697 _Shyam Sunder Gupta_, Jul 28 2003