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.

Previous Showing 31-40 of 45 results. Next

A132394 Left-truncatable primes in the order generated (with no zero digits).

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 43, 53, 73, 83, 17, 37, 47, 67, 97, 113, 313, 613, 223, 523, 823, 443, 643, 743, 353, 653, 853, 953, 173, 373, 673, 773, 283, 383, 683, 883, 983, 317, 617, 137, 337, 937, 347, 547, 647, 947, 167, 367, 467, 967, 197, 397, 797, 997, 2113
Offset: 1

Views

Author

Harry J. Smith, Nov 11 2007

Keywords

Comments

The most logical way of generating the Left-truncatable primes generates them in this order. Last term is a(4260)=357686312646216567629137.

Crossrefs

Cf. A024785.

Programs

  • PARI
    {fileO="b132394.txt";v=vector(4260);v[1]=2;v[2]=3;v[3]=5;v[4]=7;i=0;j=4; write(fileO,"1 2");write(fileO,"2 3");write(fileO,"3 5");write(fileO,"4 7"); until(i>=j,i++;p=v[i];P10=10^(1+log(p)\log(10)); for(k=1,9,z=k*P10+p;if(isprime(z),j++;v[j]=z;write(fileO,j," ",z);)));} \\ Harry J. Smith, Sep 18 2008

Extensions

Edited by Jason G. Wurtzel, Oct 06 2010

A383781 Primes where successively deleting the most significant digit yields a sequence that alternates between a prime and a nonprime at every step until a single-digit number remains.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 29, 31, 41, 59, 61, 71, 79, 89, 127, 157, 163, 193, 227, 233, 257, 263, 277, 293, 433, 457, 463, 487, 557, 563, 577, 587, 593, 677, 727, 733, 757, 787, 827, 857, 863, 877, 887, 977, 1129, 1171, 1231, 1259, 1279, 1289, 1319, 1361, 1429, 1459
Offset: 1

Views

Author

Stefano Spezia, May 09 2025

Keywords

Comments

Is this sequence infinite?
See A383782 and the comment therein. - Michael S. Branicky, May 11 2025

Examples

			127 is a term since 127 is a prime, 27 is a nonprime, and 7 is a prime;
13 is not a term since 13 and 3 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Unprotect[CompositeQ]; CompositeQ[1]:=True; Protect[CompositeQ]; Q[n_]:=And[AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i,IntegerLength[n],1,-2}], PrimeQ], AllTrue[FromDigits/@Table[Take[IntegerDigits[n], -i], {i,IntegerLength[n]-1,1,-2}], CompositeQ]]; Select[Prime[Range[240]], Q]
  • Python
    from gmpy2 import is_prime, mpz
    from itertools import count, islice
    def agen():
        olst, elst = [2, 3, 5, 7], [11, 19, 29, 31, 41, 59, 61, 71, 79, 89]
        for n in count(1):
            yield from sorted(olst + elst)
            olst2, elst2 = [], []
            for o in olst:
                o, base = o, 10**(2*n-1)
                for i in range(10*base, 100*base, base):
                    t = i + o
                    t2 = int(str(t)[1:])
                    if is_prime(t) and not is_prime(t2):
                        olst2.append(t)
            for e in elst:
                e, base = e, 10**(2*n)
                for i in range(10*base, 100*base, base):
                    t = i + e
                    t2 = int(str(t)[1:])
                    if is_prime(t) and not is_prime(t2):
                        elst2.append(t)
            olst, elst = olst2, elst2
    print(list(islice(agen(), 68))) # Michael S. Branicky, May 11 2025

A032449 Every suffix is prime and no digit is 0 or 5.

Original entry on oeis.org

2, 3, 7, 13, 17, 23, 37, 43, 47, 67, 73, 83, 97, 113, 137, 167, 173, 197, 223, 283, 313, 317, 337, 347, 367, 373, 383, 397, 443, 467, 613, 617, 643, 647, 673, 683, 743, 773, 797, 823, 883, 937, 947, 967, 983, 997, 1223, 1283, 1367, 1373, 1613, 1823, 1997
Offset: 1

Views

Author

Keywords

Comments

The last term in the sequence is a(2003) = 666276812967623946997.

Crossrefs

Cf. A024785.

Programs

  • Maple
    a:=[[2],[3],[7]]: s:=[1,2,3,4,6,7,8,9]: l1:=1: l2:=3: for n from 1 to 4 do for k from 1 to 8 do for j from l1 to l2 do d:=[op(a[j]),s[k]]: if(isprime(op(convert(d,base,10,10^nops(d)))))then a:=[op(a), d]: fi: od: od: l1:=l2+1: l2:=nops(a): if(l1>l2)then break: fi: od: seq(op(convert(a[j],base,10,10^nops(a[j]))),j=1..nops(a)); # Nathaniel Johnston, Jun 21 2011

Extensions

Corrected terms and statement about last term, Nathaniel Johnston, Jun 22 2011.

A144714 Left-truncatable primes that contain one or more zero digits.

Original entry on oeis.org

103, 107, 307, 503, 607, 907, 1013, 1097, 1103, 1307, 1607, 1907, 2003, 2017, 2053, 2083, 2503, 3023, 3037, 3067, 3083, 3307, 3607, 3907, 4003, 4007, 4013, 4073, 5003, 5023, 5107, 5503, 6007, 6037, 6043, 6047, 6053, 6067, 6073, 6607, 6907, 7013, 7043
Offset: 1

Views

Author

Harry J. Smith, Oct 08 2008

Keywords

Comments

These are the terms in sequence A033664 that are not in A024785. This sequence is infinitely long.

Crossrefs

Programs

  • PARI
    zeroin(z)={until(z==0,q=z\10;r=z-10*q;if(r==0,return(1));z=q;);return(0);}
    {fileO="b144714.txt";v=vector(15000);v[1]=2;v[2]=3;v[3]=5;v[4]=7;j=4;m=0;
    p10=1;until(0,p10*=10;j0=j;for(k=1,9,k10=k*p10;for(i=1,j0,z=k10+v[i];
    if(isprime(z),j++;v[j]=z;if(zeroin(z),m++;
    write(fileO,m," ",z);if(m==10000,break(3));)))));}

A173057 Partial sums of A024770.

Original entry on oeis.org

2, 5, 10, 17, 40, 69, 100, 137, 190, 249, 320, 393, 472, 705, 944, 1237, 1548, 1861, 2178, 2551, 2930, 3523, 4122, 4841, 5574, 6313, 7110, 9443, 11782, 14175, 16574, 19513, 22632, 25769, 29502, 33241, 37034, 40831, 46770, 53963, 61294, 68627
Offset: 1

Views

Author

Jonathan Vos Post, Feb 08 2010

Keywords

Comments

Partial sums of right-truncatable primes, primes whose every prefix is prime (in decimal representation). The sequence has 83 terms. The subsequence of prime partial sums of right-truncatable primes begins: 2, 5, 17, 137, 1237, 1861, 2551, 199483. What is the largest value in the subsubsequence of right-truncatable prime partial sums of right-truncatable primes?

Examples

			a(50) = 2 + 3 + 5 + 7 + 23 + 29 + 31 + 37 + 53 + 59 + 71 + 73 + 79 + 233 + 239 + 293 + 311 + 313 + 317 + 373 + 379 + 593 + 599 + 719 + 733 + 739 + 797 + 2333 + 2339 + 2393 + 2399 + 2939 + 3119 + 3137 + 3733 + 3739 + 3793 + 3797 + 5939 + 7193 + 7331 + 7333 + 7393 + 23333 + 23339 + 23399 + 23993 + 29399 + 31193 + 31379.
		

Crossrefs

A240768 Left-truncatable primes p with property that prepending any single decimal digit to p does not produce a prime.

Original entry on oeis.org

2, 5, 773, 3373, 3947, 4643, 5113, 6397, 6967, 7937, 15647, 16823, 24373, 33547, 34337, 37643, 56983, 57853, 59743, 62383, 63347, 63617, 69337, 72467, 72617, 75653, 76367, 87643, 92683, 97883, 98317, 121997, 124337, 163853, 213613, 236653, 242467, 242797
Offset: 1

Views

Author

Arkadiusz Wesolowski, Apr 12 2014

Keywords

Examples

			3373 belongs to this sequence because 3373, 373, 73 and 3 are all prime; k*10^4 + 3373, for k = 1 to 9, are all composite.
		

Crossrefs

Subsequence of A024785 and of A155762.

Programs

  • PARI
    for(n=2, 242797, v=n; while(isprime(n), c=n; n=lift(Mod(c, 10^(#Str(c)-1))); if(!(#Str(c)-#Str(n)==1), break)); if(n==0, s=#Str(v); t=0; for(k=1, 9, if(isprime(k*10^s+v), break, t++)); if(t==9, print1(v, ", "))); n=v);

Formula

A024785 INTERSECT A155762.

A253386 Suffixes of 3991687693967 (left-truncatable prime).

Original entry on oeis.org

7, 67, 967, 3967, 93967, 693967, 7693967, 87693967, 687693967, 1687693967, 91687693967, 991687693967, 3991687693967
Offset: 1

Views

Author

Mikk Heidemaa, Dec 31 2014

Keywords

Comments

3991687693967 (13 digits) includes the longest (7 digits) palindromic prime suffix (7693967) among the left-truncatable primes (digit '0' excluded). The largest one (24 digits, see A253427) contains a nonprime palindrome of 7 digits (1264621). The terms from a(3) to a(13) cannot be written as a sum of 3 squares.

Examples

			Triangular form:
----------------
............7
...........67
..........967*
.........3967
........93967
.......693967
......7693967**
.....87693967
....687693967
...1687693967
..91687693967
.991687693967
3991687693967***
----------------
* None from 3rd row (967,...,3991687693967) cannot be written as a sum of 3 squares.
** The palindromic prime suffix.
*** a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g * h * i = 3991687693967;
a=693967; b=93967; c=3967; d=967; e=67; f=7; g=4114278523; h=37; i=27.
a^2 + b^2 + c^2 + d^2 + e^2 + f^2 + g * h * i = 3991687693967^5;
a=693967; b=93967; c=3967; d=967; e=67; f=7;
g=3571123727278334614405609468109056139549629; h=228288322626423; i=124339.
(All primes.)
		

Crossrefs

Programs

  • Mathematica
    Column[ Table[ Mod[ 3991687693967, 10^n], {n, 13}], Right] (* Mikk Heidemaa, Oct 07 2017 *)

Formula

a(n) = 3991687693967 mod 10^n for 1 <= n <= 13. - Mikk Heidemaa, Oct 07 2017

A253427 Number of left-truncatable n-digit primes with least significant digit 7.

Original entry on oeis.org

1, 5, 17, 47, 89, 150, 199, 238, 264, 257, 230, 181, 139, 117, 70, 46, 33, 19, 11, 5, 5, 4, 3, 1
Offset: 1

Views

Author

Mikk Heidemaa, Dec 31 2014

Keywords

Comments

Number of n-digit (n <= 24) truncatable primes (i.e., left-truncatable with the least significant digit 7; only prime suffixes without digit '0'). Formed by successively prepending a digit (1,...,9) to the most significant digit (1st is 7) while preserving primality; a(13) with 139 members includes A253386 (includes the palindromic prime suffix 7693967), but a(24) includes just a single one, 357686312646216567629137 (contains the nonprime palindrome 1264621).

Examples

			a(1)=1 {7};
a(2)=5 {17,37,47,67,97};
...
a(23)=3 {57686312646216567629137, 95918918997653319693967, 96686312646216567629137};
a(24)=1 {357686312646216567629137}; see also A012885.
		

Crossrefs

Programs

  • Maple
    S[1]:= {7}:
    for n from 2 while nops(S[n-1]) > 0 do
      S[n]:= select(isprime, {seq(seq(i*10^(n-1)+s, i=1..9),s = S[n-1])})
    od:
    seq(nops(S[i]),i=1..n-2); # Robert Israel, Jan 01 2015

A308711 Left-truncatable primes in base-10 bijective numeration.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 37, 43, 47, 53, 67, 73, 83, 97, 103, 107, 113, 137, 167, 173, 197, 223, 283, 307, 313, 317, 337, 347, 353, 367, 373, 383, 397, 443, 467, 503, 523, 547, 607, 613, 617, 643, 647, 653, 673, 683, 743, 773, 797, 823, 853, 883, 907, 937, 947, 953, 967, 983, 997
Offset: 1

Views

Author

Robin Houston, Jun 19 2019

Keywords

Comments

Not identical to A033664; in fact a strict subsequence of A033664. For example, 2003 belongs to A033664 but not to this sequence, since in bijective numerals 2003 is 19X3, whose suffix 9X3 = 1003 = 17 * 59.

Crossrefs

Programs

  • Sage
    DIGITS = "123456789X"
    DECODE = {d: i + 1 for i, d in enumerate(DIGITS)}
    def decode(s):
        return reduce(lambda n, c: 10 * n + DECODE[c], s, 0)
    def search(s):
        n = decode(s)
        if n > 0:
            if not is_prime(n): return
            yield n
        for digit in DIGITS: yield from search(digit + s)
    full = sorted(search(""))
    full[:10]

A385404 Numbers that can be split into two at any place between their digits such that the resulting numbers are always a nonprime on the left and a prime on the right.

Original entry on oeis.org

12, 13, 15, 17, 42, 43, 45, 47, 62, 63, 65, 67, 82, 83, 85, 87, 92, 93, 95, 97, 123, 143, 147, 153, 167, 183, 423, 443, 447, 453, 467, 483, 497, 623, 637, 643, 647, 653, 667, 683, 697, 813, 817, 823, 843, 847, 853, 867, 873, 883, 913, 917, 923, 937, 943, 947, 953, 967, 983, 997
Offset: 1

Views

Author

Tamas Sandor Nagy, Jun 27 2025

Keywords

Comments

As no leading zeros are allowed, all terms are zeroless.
From Michael S. Branicky, Jun 27 2025: (Start)
Finite since each term with first digit removed must be a member of A024785, which is finite.
Last term here is a(7407) = 6357686312646216567629137. (End)

Examples

			637 is a term because when it is split in two in all possible ways, it first results in 63, a nonprime, and 3, a prime. When split in the second and final possible way, it results in 6, a nonprime, and 37, a prime.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := !MemberQ[IntegerDigits[n], 0] && AllTrue[Range[IntegerLength[n]-1], PrimeQ[QuotientRemainder[n, 10^#]] == {False, True} &]; Select[Range[10, 1000], q] (* Amiram Eldar, Jun 27 2025 *)
  • Python
    from sympy import isprime
    def ok(n): return '0' not in (s:=str(n)) and len(s) > 1 and all(not isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(1000) if ok(k)]) # Michael S. Branicky, Jun 27 2025
    
  • Python
    # uses import and function ok above
    from itertools import count, islice, product
    def agen():  # generator of terms
        tp = list("23579")  # set of left-truncatable primes
        for d in count(2):
            tpnew = []
            for f in "123456789":
                for e in tp:
                    if isprime(int(s:=f+e)):
                        tpnew.append(s)
                    if ok(t:=int(f+e)):
                        yield t
            tp = tpnew
            if len(tp) == 0:
                return
    afull = list(agen())
    print(afull[:60]) # Michael S. Branicky, Jun 27 2025
Previous Showing 31-40 of 45 results. Next