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-8 of 8 results.

A227916 Primes that remain prime when the leftmost digit is removed.

Original entry on oeis.org

13, 17, 23, 37, 43, 47, 53, 67, 73, 83, 97, 103, 107, 113, 131, 137, 167, 173, 179, 197, 211, 223, 229, 241, 271, 283, 307, 311, 313, 317, 331, 337, 347, 353, 359, 367, 373, 379, 383, 389, 397, 419, 431, 443, 461, 467, 479, 503, 523, 541, 547, 571, 607, 613, 617
Offset: 1

Views

Author

K. D. Bajpai, Oct 13 2013

Keywords

Examples

			a(11)= 97 which is prime. Removing the leftmost digit gives 7, also prime.
a(28)= 311 which is prime. Removing the leftmost digit gives 11, also prime.
		

Crossrefs

Cf. A000040 (prime numbers), A024785 (left-truncatable primes).
Cf. A137812 (left- or right-truncatable primes).
Cf. A227919 (primes which remain prime when rightmost digit is removed).

Programs

  • Maple
    KD:= proc() local a,b,c,d; a:=ithprime(n);b:=length(a); c:=floor(a/(10^(b-1)));d:=a-c*(10^(b-1));if isprime(d) then return(a):fi; end:seq(KD(),n=1..5000);

A232125 Smallest prime such that the n numbers obtained by removing 1 digit on the right are also prime, while no digit can be added on the right to get another prime.

Original entry on oeis.org

53, 53, 317, 2393, 23333, 373393, 2399333, 23399339, 1979339333, 103997939939, 4099339193933, 145701173999399393, 2744903797739993993333, 52327811119399399313393, 13302806296379339933399333
Offset: 0

Views

Author

Michel Marcus, Nov 19 2013

Keywords

Comments

Inspired by article on 43 in Archimedes' Lab link.

Examples

			a(0)=53 because 53 is the smallest prime such that all numbers obtained by adding a digit to the right are composite.
a(1)=53 because 5 and 53 are primes.
a(2)=317 because 3, 31, 317 are all primes, and 317 has the same property as 53 when adding a digit to the right.
		

Crossrefs

Programs

  • PARI
    a(n) = {n++; v = vector(n); i = 1; ok = 0; until (ok, while ((i>1) && (v[i] == 9), v[i] = 0; i--); if (i == 1, v[i] = nextprime(v[i]+1), v[i] = v[i]+1); curp = sum (j=1, i, v[j]*(10^(i-j))); if (isprime(curp), if (i != n, i++, nbp = 0; for (z=1, 9, if (isprime(10*curp+z), nbp++);); if (nbp == 0, ok = 1);););); sum (j=1, n, v[j]*(10^(n-j)));}
    
  • Python
    from sympy import isprime, nextprime
    def a(n):
        p, oo = 2, float('inf')
        while True:
            extends, reach, r1 = 0, [str(p)], []
            while len(reach) > 0 and extends <= n:
                minnotext = oo
                for s in reach:
                    wasextended = False
                    for d in "1379":
                        if isprime(int(s+d)): r1.append(s+d); wasextended = True
                    if not wasextended: minnotext = min(minnotext, int(s))
                if extends == n and minnotext < oo: return minnotext
                if len(r1) > 0: extends += 1
                reach, r1 = r1, []
            p = nextprime(p)
    for n in range(12): print(a(n), end=", ") # Michael S. Branicky, Aug 08 2021

Extensions

a(12)-a(13) from Michael S. Branicky, Aug 08 2021
a(14) from Michael S. Branicky, Aug 23 2021

A235687 Semiprimes which remain semiprimes when the rightmost digit is removed.

Original entry on oeis.org

46, 49, 62, 65, 69, 91, 93, 94, 95, 106, 141, 142, 143, 145, 146, 155, 158, 159, 213, 214, 215, 217, 218, 219, 221, 226, 253, 254, 259, 262, 265, 267, 334, 335, 339, 341, 346, 355, 358, 381, 382, 386, 391, 393, 394, 395, 398, 466, 469, 493, 497, 511, 514
Offset: 1

Views

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			514 is in the sequence because 51 = 3*17.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[600],PrimeOmega[#]==2==PrimeOmega[FromDigits[ Most[ IntegerDigits[ #]]]]&] (* Harvey P. Dale, Oct 02 2014 *)
    Select[Range[600],PrimeOmega[#]==PrimeOmega[Quotient[#,10]]==2&] (* Harvey P. Dale, Mar 18 2023 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(1000); for(n=1, #t, if(issemiprime(t[n]\10), print1(t[n],", ")))

A235688 Semiprimes which remain semiprimes when the leftmost digit is removed.

Original entry on oeis.org

14, 26, 34, 39, 46, 49, 69, 74, 86, 94, 106, 115, 121, 122, 133, 134, 146, 155, 158, 169, 177, 185, 187, 194, 206, 209, 214, 215, 221, 226, 235, 249, 262, 265, 274, 287, 291, 295, 309, 314, 321, 326, 334, 335, 339, 346, 355, 358, 362, 365, 377, 382, 386, 391
Offset: 1

Views

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			249 is in the sequence because 49 = 7*7.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[400],PrimeOmega[#]==PrimeOmega[Mod[#,10^(IntegerLength[ #]-1)]] == 2&] (* Harvey P. Dale, Jun 07 2017 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    delleft(a) = my(b, c); b=#Str(a); c=a\(10^(b-1)); a-c*(10^(b-1))
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(500); for(n=1, #t, if(issemiprime(delleft(t[n])), print1(t[n],", ")))

A234901 Primes which remain prime when the digits are rotated once to the right.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 173, 197, 199, 271, 277, 311, 313, 337, 373, 379, 397, 419, 479, 491, 571, 577, 593, 617, 631, 673, 719, 733, 811, 839, 877, 911, 919, 971, 977, 991, 1031, 1039, 1091, 1093, 1097, 1171, 1193, 1213
Offset: 1

Views

Author

Colin Barker, Jan 01 2014

Keywords

Examples

			The prime 1097 is in the list because 7109 is also prime.
		

Crossrefs

Programs

  • Magma
    r:=func; [p: p in PrimesUpTo(1300) | IsPrime(r(p))]; // Bruno Berselli, Jul 04 2014
  • Mathematica
    Select[Prime[Range[200]],PrimeQ[FromDigits[RotateRight[IntegerDigits[#]]]]&] (* Harvey P. Dale, May 05 2022 *)
  • PARI
    rotr(a) = if(a<10, a, eval(Str(a%10, a\10)))
    s=[]; forprime(n=2, 2000, if(isprime(rotr(n)), s=concat(s, n))); s
    

A235689 Semiprimes which remain semiprimes when the leftmost and rightmost digits are removed.

Original entry on oeis.org

141, 142, 143, 145, 146, 161, 166, 169, 194, 247, 249, 262, 265, 267, 291, 295, 298, 299, 341, 346, 361, 362, 365, 391, 393, 394, 395, 398, 445, 446, 447, 466, 469, 493, 497, 542, 543, 545, 562, 565, 566, 591, 597, 649, 662, 667, 669, 694, 695, 697, 698, 699
Offset: 1

Author

Colin Barker, Jan 14 2014

Keywords

Examples

			169 = 13^2 is in the sequence because 6 = 2*3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100,700],PrimeOmega[#]==PrimeOmega[FromDigits[ Rest[ Most[ IntegerDigits[ #]]]]] ==2&] (* Harvey P. Dale, Nov 22 2018 *)
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    delleft(a) = my(b, c); b=#Str(a); c=a\(10^(b-1)); a-c*(10^(b-1))
    issemiprime(n) = n>0 && bigomega(n)==2
    t=list(700); for(n=1, #t, if(issemiprime(delleft(t[n]\10)), print1(t[n],", ")))

A258032 Primes p such that p^3 with the rightmost digit removed is also prime.

Original entry on oeis.org

3, 17, 53, 113, 157, 233, 257, 277, 353, 359, 379, 397, 677, 877, 997, 1039, 1217, 1439, 1613, 1697, 1879, 1973, 1997, 2273, 2417, 2459, 2777, 3257, 3413, 3499, 3517, 3697, 3779, 4073, 4157, 4177, 4339, 4973, 4999, 5077, 5197, 5279, 5639, 5813, 5897, 6277, 6379
Offset: 1

Author

K. D. Bajpai, May 16 2015

Keywords

Examples

			a(2) = 17 is prime: 17^3 = 4913. Removing rightmost digit gives 491 which is prime.
a(3) = 53 is prime: 53^3 = 148877. Removing rightmost digit gives 14887 which is prime.
		

Crossrefs

Programs

  • Haskell
    a258032 n = a258032_list !! (n-1)
    a258032_list = filter ((== 1) . a010051' . flip div 10. (^ 3)) a000040_list
    -- Reinhard Zumkeller, May 18 2015
  • Magma
    [p: p in PrimesUpTo(6500) |IsPrime(Floor(p^3/10))]; // Vincenzo Librandi, May 17 2015
    
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[Floor[(#^3)/10]] &]
  • PARI
    forprime(p=1,10000, if(isprime(floor((p^3)/10)), print1(p,", ")))
    

A289190 Numbers k such that k^2 with last digit deleted is a prime.

Original entry on oeis.org

5, 6, 14, 26, 44, 46, 56, 64, 74, 76, 86, 94, 106, 146, 154, 164, 206, 226, 236, 244, 254, 256, 274, 286, 296, 304, 314, 326, 344, 346, 364, 424, 436, 446, 454, 464, 506, 524, 536, 596, 614, 664, 674, 676, 686, 694, 706, 764, 776, 796, 826, 844, 854, 874, 944, 946
Offset: 1

Author

K. D. Bajpai, Jun 27 2017

Keywords

Examples

			14 is in the sequence because 14^2 = 196; deleting the last digit gives 19 which is prime.
26 is in the sequence because 26^2 = 676; deleting the last digit gives 67 which is prime.
		

Programs

  • Magma
    [n : n in [1 .. 2000] | IsPrime (Floor (n^2/10))];
    
  • Maple
    select(n -> isprime(floor(n^2/10)),[$1..2000]);
  • Mathematica
    fQ[n_] := PrimeQ@Quotient[n^2, 10]; Select[Range[1, 2000], fQ]
  • PARI
    isok(n) = isprime(n^2\10); \\ Michel Marcus, Jul 02 2017
Showing 1-8 of 8 results.