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 11-18 of 18 results.

A254753 Composite numbers with only prime proper prefixes and suffixes in base 10.

Original entry on oeis.org

22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 237, 297, 537, 597, 713, 717, 737, 2337, 2397, 2937, 3113, 3173, 5937, 5997, 7197, 7337, 7397, 29397, 31373, 37937, 59397, 73313
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Comments

A proper prefix (or suffix) of a number m is one which is neither void, nor identical to m.
Alternative definition: Slicing the decimal expansion of a composite a(n) in any way into two nonempty parts, each part represents a prime number.
This sequence is a subset of A254751. Every proper prefix of each member a(n) is a member of A024770, and every proper suffix is a member of A024785. Since the latter are finite sequences, a(n) is also a finite sequence. It has 34 members, the largest of which is the composite number 73313.
Should one change the definition to 'prime numbers such that, in base 10, all their proper prefixes and suffixes represent primes', the result would be the sequence A020994.

Examples

			6 is not a member because its expansion cannot be sliced in two.
The composite 73313 is a member because (7, 3313, 73, 313, 733, 13, 7331, 3) are all primes.
		

Crossrefs

Programs

  • Mathematica
    apQ[n_]:=Module[{idn=IntegerDigits[n],c1,c2},c1=FromDigits/@ Table[ Take[ idn,k],{k,Length[idn]-1}];c2=FromDigits/@Table[Take[idn,k],{k,-(Length[ idn]-1), -1}]; AllTrue[ Join[c1,c2],PrimeQ]]; Select[Range[ 10,80000], CompositeQ[#] && apQ[#]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 29 2018 *)
  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    slicesIntoPrimes(n,b=10) = {my(k=b);if(n0,if(!isprime(n\k)||!isprime(n%k),return(0););k*=b;);1;}
    isCompositeSlicingIntoPrimes(n,b=10) = isComposite(n) && slicesIntoPrimes(n,b);

A323137 Largest prime that is both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

23, 11, 67, 839, 37, 1867, 173, 739397, 79, 105691, 379, 37573, 647, 3389, 631, 202715129, 211, 155863, 1283, 787817, 439, 109893629, 577, 4195880189, 1811, 14474071, 379, 21335388527, 2203, 1043557, 2939, 42741029, 2767, 50764713107, 853, 65467229, 4409, 8524002457
Offset: 3

Views

Author

Felix Fröhlich, Jan 05 2019

Keywords

Examples

			For n = 12: 105691 is 511B7 in base 12. Successively removing the leftmost digit yields the base-12 numbers 11B7, 1B7, B7 and 7. When converted to base 10, these are 2011, 283, 139 and 7, respectively, all primes. Successively removing the rightmost digit yields the base-12 numbers 511B, 511, 51 and 5. When converted to base 10, these are 8807, 733, 61 and 5, respectively, all primes. Since no larger prime with this property in base 12 exists (as proven by Daniel Suteu), a(12) = 105691.
		

Crossrefs

Programs

  • PARI
    digitsToNum(d, base) = sum(k=1, #d, base^(k-1) * d[k]);
    isLeftTruncatable(d, base) = my(ok=1); for(k=1, #d, if(!isprime(digitsToNum(d[1..k], base)), ok=0; break)); ok;
    generateFromPrefix(p, base) = my(seq = [p]); for(n=1, base-1, my(t=concat(n, p)); if(isprime(digitsToNum(t, base)), seq=concat(seq, select(v -> isLeftTruncatable(v, base), generateFromPrefix(t, base))))); seq;
    bothTruncatablePrimesInBase(base) = my(t=[]); my(P=primes(primepi(base-1))); for(k=1, #P, t=concat(t, generateFromPrefix([P[k]], base))); vector(#t, k, digitsToNum(t[k], base));
    a(n) = vecmax(bothTruncatablePrimesInBase(n)); \\ for n>=3; Daniel Suteu, Jan 22 2019

Formula

a(n) <= min(A023107(n), A103443(n)). - Daniel Suteu, Feb 24 2019

Extensions

a(17)-a(40) from Daniel Suteu, Jan 11 2019

A323396 Irregular array read by rows, where T(n, k) is the k-th prime that is both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

2, 23, 2, 3, 11, 2, 3, 13, 17, 67, 2, 3, 5, 17, 23, 83, 191, 479, 839, 2, 3, 5, 17, 19, 23, 37, 2, 3, 5, 7, 19, 23, 29, 31, 43, 47, 59, 61, 139, 157, 239, 251, 331, 349, 379, 479, 491, 1867, 2, 3, 5, 7, 23, 29, 47, 173, 2, 3, 5, 7, 23, 37, 53, 73, 313, 317, 373, 797, 3137, 3797, 739397
Offset: 3

Views

Author

Daniel Suteu and Felix Fröhlich, Jan 13 2019

Keywords

Comments

The n-th row contains A323390(n) terms.
The largest term in the n-th row is given by A323137(n).

Examples

			Rows for n = 3..7:
  [2, 23]
  [2,  3, 11]
  [2,  3, 13, 17, 67]
  [2,  3,  5, 17, 23, 83, 191, 479, 839]
  [2,  3,  5, 17, 19, 23,  37]
		

Crossrefs

Programs

  • PARI
    digitsToNum(d, base) = sum(k=1, #d, base^(k-1) * d[k]);
    isLeftTruncatable(d, base) = my(ok=1); for(k=1, #d, if(!isprime(digitsToNum(d[1..k], base)), ok=0; break)); ok;
    generateFromPrefix(p, base) = my(seq = [p]); for(n=1, base-1, my(t=concat(n, p)); if(isprime(digitsToNum(t, base)), seq=concat(seq, select(v -> isLeftTruncatable(v, base), generateFromPrefix(t, base))))); seq;
    bothTruncatablePrimesInBase(base) = my(t=[]); my(P=primes(primepi(base-1))); for(k=1, #P, t=concat(t, generateFromPrefix([P[k]], base))); vector(#t, k, digitsToNum(t[k], base));
    row(n) = vecsort(bothTruncatablePrimesInBase(n));
    T(n,k) = row(n)[k];

A323390 Total number of primes that are both left-truncatable and right-truncatable in base n.

Original entry on oeis.org

0, 2, 3, 5, 9, 7, 22, 8, 15, 6, 35, 11, 37, 17, 22, 12, 69, 12, 68, 18, 44, 13, 145, 16, 47, 20, 77, 13, 291, 15, 89, 27, 74, 20, 241, 18, 106, 25, 134, 15, 450, 23, 144, 33, 131, 24, 491, 27, 235, 29, 187, 23, 575, 30, 218, 31, 183, 25, 1377, 26, 247, 37, 231
Offset: 2

Views

Author

Daniel Suteu, Jan 13 2019

Keywords

Examples

			For n = 2, there are no both-truncatable primes, therefore a(2) = 0.
For n = 3, there are 2 both-truncatable primes: 2, 23.
For n = 4, there are 3 both-truncatable primes: 2, 3, 11.
For n = 5, there are 5 both-truncatable primes: 2, 3, 13, 17, 67.
For n = 6, there are 9 both-truncatable primes: 2, 3, 5, 17, 23, 83, 191, 479, 839.
		

Crossrefs

Programs

  • PARI
    digitsToNum(d, base) = sum(k=1, #d, base^(k-1) * d[k]);
    isLeftTruncatable(d, base) = my(ok=1); for(k=1, #d, if(!isprime(digitsToNum(d[1..k], base)), ok=0; break)); ok;
    generateFromPrefix(p, base) = my(seq = [p]); for(n=1, base-1, my(t=concat(n, p)); if(isprime(digitsToNum(t, base)), seq=concat(seq, select(v -> isLeftTruncatable(v, base), generateFromPrefix(t, base))))); seq;
    bothTruncatablePrimesInBase(base) = my(t=[]); my(P=primes(primepi(base-1))); for(k=1, #P, t=concat(t, generateFromPrefix([P[k]], base))); vector(#t, k, digitsToNum(t[k], base));
    a(n) = #(bothTruncatablePrimesInBase(n));

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

A173060 Partial sums of A024785.

Original entry on oeis.org

2, 5, 10, 17, 30, 47, 70, 107, 150, 197, 250, 317, 390, 473, 570, 683, 820, 987, 1160, 1357, 1580, 1863, 2176, 2493, 2830, 3177, 3530, 3897, 4270, 4653, 5050, 5493, 5960, 6483, 7030, 7643, 8260, 8903, 9550, 10203, 10876, 11559, 12302, 13075, 13872
Offset: 1

Views

Author

Jonathan Vos Post, Feb 08 2010

Keywords

Comments

Partial sums of left-truncatable primes. This sequence has 4260 terms. The subsequence of prime partial sums of left-truncatable primes begins 2, 5, 17, 47, 107, 197, 317, 683, 7643. The subsubsequence of left-truncatable prime partial sums of left-truncatable primes begins 2, 5, 197, 317.

Examples

			a(57) = 2 + 3 + 5 + 7 + 13 + 17 + 23 + 37 + 43 + 47 + 53 + 67 + 73 + 83 + 97 + 113 + 137 + 167 + 173 + 197 + 223 + 283 + 313 + 317 + 337 + 347 + 353 + 367 + 373 + 383 + 397 + 443 + 467 + 523 + 547 + 613 + 617 + 643 + 647 + 653 + 673 + 683 + 743 + 773 + 797 + 823 + 853 + 883 + 937 + 947 + 953 + 967 + 983 + 997 + 1223 + 1283 + 1367.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] A024785(i) = SUM[i=1..n] {p prime, and every suffix of p in decimal expansion is prime, and no digits are zero}.

A284060 Primes that are left-, left/right-, and right-truncatable.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 73, 373, 3137, 3797
Offset: 1

Views

Author

Rick L. Shepherd, Mar 19 2017

Keywords

Comments

Intersection of A020994 and A077390. Only the last three terms exhibit all three properties nontrivially.

Examples

			The prime 3797 is a term because it is a term of A024785 (truncating from the left: 797, 97, 7 are primes), of A077390 (truncating the same number of digits from left and from right: 79 is a prime), and of A024770 (truncating from the right: 379, 37, 3 are primes). The digit 9 is not a prime, so 3797 is not also a term of A085823.
		

Crossrefs

Cf. A020994, A024770, A024785, A077390, A085823 (a subsequence).
Previous Showing 11-18 of 18 results.