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.

Showing 1-5 of 5 results.

A086673 Number of right-truncatable semiprimes <= n.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 10, 11, 12, 12, 12, 12
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 27 2003

Keywords

Crossrefs

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.

Original entry on oeis.org

4, 6, 9, 14, 26, 34, 39, 46, 49, 69, 74, 86, 94, 134, 146, 169, 194, 214, 226, 249, 274, 314, 326, 334, 339, 346, 386, 394, 446, 469, 514, 526, 586, 614, 626, 634, 649, 669, 674, 694, 734, 746, 749, 794, 849, 869, 886, 914, 926, 934, 939, 949, 974, 1169, 1214
Offset: 1

Views

Author

Shyam Sunder Gupta, Jul 28 2003

Keywords

Comments

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

Examples

			a(15)=146 is a term because 146, 46, 6 are all semiprimes.
		

Crossrefs

Cf. A001358 (semiprimes), A085733 (right-truncatable).

Programs

  • Mathematica
    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 *)
    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 *)
  • Python
    from sympy import factorint
    from itertools import islice
    def issemiprime(n): return sum(factorint(n).values()) == 2
    def agen():
        semis, digits = [4, 6, 9], "123456789" # can't have 0
        while len(semis) > 0:
            yield from semis
            cands = set(int(d+str(p)) for p in semis for d in digits)
            semis = sorted(c for c in cands if issemiprime(c))
    print(list(islice(agen(), 55))) # Michael S. Branicky, Aug 04 2022

A213017 Largest possible number of digits in a base n right-truncatable semiprime.

Original entry on oeis.org

0, 0, 0, 8, 22, 30, 31, 35, 38, 43, 48, 51
Offset: 2

Views

Author

Hugo Pfoertner, Jun 07 2012

Keywords

Comments

Right-truncatable semiprimes are numbers, where the number itself and all numbers obtained by successively removing the rightmost digit are semiprimes. S. S. Gupta found the largest possible right-truncatable base 10 semiprime to be 95861957783594714393831931415189937897 (38 decimal digits). Digit counts for largest possible right-truncatable semiprimes in other bases, found by Hermann Jurksch, are given in this sequence.

Examples

			There are no right-truncatable semiprimes in bases 2,3 and 4 thus a(2)=a(3)=a(4)=0;
The examples give the smallest base n semiprimes of maximum digit count, found by H. Jurksch:
a(5)=8: 42143413
a(6)=22: 4223145115415551545111
a(7)=30: 644324264233631242462662622646
a(8)=31: 4267773725372537135533515117773
a(9)=35: 43741424882428682844851886888222774
a(10)=38: 93359393537779942973989331953313839313
a(11)=43: 4567476a2738a828994aa851a116aa886a95686a231
a(12)=48: 43a2971ba155719171a2b1b97777775b779a732b755572b7
a(13)=51: 9114448462c6c46b3c9937446466b43686a246686667324c6a2
		

Crossrefs

Programs

  • Python
    from sympy import factorint
    def fromdigits(t, b): return sum(b**i*di for i, di in enumerate(t[::-1]))
    def semiprime(n): return sum(factorint(n).values()) == 2
    def a(n):
        d, s = 0, [(i,) for i in range(n) if semiprime(fromdigits((i,), n))]
        while len(s) > 0:
            cands = set(t+(d,) for t in s for d in tuple(range(n)))
            d, s = d+1, [c for c in cands if semiprime(fromdigits(c, n))]
        return d
    print([a(n) for n in range(2, 8)]) # Michael S. Branicky, Aug 04 2022

A213018 Largest possible right-truncatable base n semiprime, written in decimal notation.

Original entry on oeis.org

349859, 96614184696363331, 21453921664462866568480385, 5396625577204731352098054139, 1230847457959658263441326143300761, 95861957783594714393831931415189937897, 246968512564969427282294385793684699270364003, 2275670244821939317343219562642735197101789412250091, 452359410421075824795509870868069265597540337861667320077
Offset: 5

Views

Author

Hugo Pfoertner, Jun 26 2012

Keywords

Comments

For the definition of a right-truncatable semiprime, see A213017. The process of truncating at the right end of the digit string has to be applied to the base-n representation given in the examples. a(10) was found by S.S. Gupta. All other terms have been computed by Hermann Jurksch.

Examples

			a(5)=349859=42143414 in base 5 = 89*3931
4214341 in base 5 = 69971 = 11*6361
421434 in base 5 = 13994 = 2*6997
42143 in base 5 = 2798 = 2*1399
4214 in base 5 = 559 = 13*43
421 in base 5 = 111 = 3*37
42 in base 5 = 22 = 2*11
4 in base 5 = 4 = 2*2
a(6)=4223145115415551545111 in base 6
a(7)=644324264233631242462662622646 in base 7
a(8)=4267773725372537135533515117773 in base 8
a(9)=43741424882428682844851886888222774 in base 9
a(10)=95861957783594714393831931415189937897 in base 10
a(11)=4567476a2738a828994aa851a116aa886a95686a231 in base 11
a(12)=43a2971ba155719171a2b1b97777775b779a732b755572b7 in base 12
a(13)=9114448462c6c46b3c9937446466b43686a24668666732c4356 in base 13
		

Crossrefs

Programs

  • Python
    from sympy import factorint
    def fromdigits(t, b): return sum(b**i*di for i, di in enumerate(t[::-1]))
    def semiprime(n): return sum(factorint(n).values()) == 2
    def a(n):
        m, s = 0, [(i,) for i in range(n) if semiprime(fromdigits((i,), n))]
        while len(s) > 0:
            m = fromdigits(max(s), n)
            cands = set(t+(d,) for t in s for d in tuple(range(n)))
            s = [c for c in cands if semiprime(fromdigits(c, n))]
        return m
    print([a(n) for n in range(5, 8)]) # Michael S. Branicky, Aug 04 2022

A213019 Largest n-digit right-truncatable semiprime.

Original entry on oeis.org

9, 95, 959, 9599, 95999, 959999, 9599999, 95999987, 959999879, 9599998799, 95999987999, 959999879999, 9599998791827, 95999987918279, 959999879182793, 9599998791715333, 95999987917153339, 959999879171533399, 9599998791715333999, 95999987917153339993
Offset: 1

Views

Author

Hugo Pfoertner, Jun 27 2012

Keywords

Comments

For the definition of a right-truncatable semiprime, see A213017. The largest possible right-truncatable semiprime a(38) = A085733(56076) = 95861957783594714393831931415189937897, found by S.S. Gupta, is the last term of this sequence.

Examples

			a(1) = 9 = 3*3
a(2) = 95 = 5*19 and none of 96, 97, 98, 99 semiprime
a(3) = 959 = 7*137
a(4) = 9599 = 29*331
a(5) = 95999 = 17*5647
a(6) = 959999 = 643*1493
a(7) = 9599999 = 1019*9421
a(8) = 95999987 = 7349*13063, 9599998 = 2*4799999 and none of 95999988 ... 95999999 semiprime
		

Crossrefs

Showing 1-5 of 5 results.