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

A238850 Right-truncatable reversible primes in base 10.

Original entry on oeis.org

2, 3, 5, 7, 31, 37, 71, 73, 79, 311, 313, 373, 733, 739, 797, 3733
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

In a general base b, a number qualifies as a member iff: (i) it is a prime, (ii) when its digits in base b are reversed, it is still a prime, and (iii) when, in base b, it has more than one digit and the least significant one is dropped, the remaining prefix has the same properties. This implies that any base-b prefix of such a number, no matter how many right-side digits are truncated, is still a right-truncatable reversible prime. Sequences of this type appear to be all finite (see A238854, A238855, and A238856, used as examples).
This particular sequence is for base b = 10.
See also A238854 for comments on a more general context.

Examples

			739 is a member because it is a prime and so is 937, as well as the pair (73, 37) and 7.
		

Crossrefs

In base 16: A238851, 100: A238852, 256: A238853.
In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238851 Right-truncatable, reversible primes in base 16.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 53, 59, 61, 83, 89, 113, 179, 191, 211, 863, 947, 977, 983, 991, 1429, 1439, 1823, 3061, 3067, 3389, 15161, 15643, 15733, 15737, 15739, 15859, 23029, 48989, 48991, 251737, 251831, 253751, 368471, 4060019
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

See A238850 for definitions, and A238854 for comments on general context.
These numbers are fully right-truncatable and reversible primes in base 16 (but listed in decimal format). They are 40 in all.

Examples

			The largest such number (4060019) is in hex format 0x3DF373. It is a prime, so is 0x373FD3, and 0x3DF37 has again the same properties.
		

Crossrefs

Cf. All in base 10: A238850, 100: A238852, 256: A238853.
Cf. In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

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

A094335 Largest right-truncatable prime number in base n if 1 is considered as a prime (written in base 10).

Original entry on oeis.org

47, 71, 2039, 2437, 108863, 33487, 4497359, 1355840309, 1979339339, 6774006887, 2081628860747539, 122311273757, 6525460043032393259, 927920056668659, 1429175974256442233, 4928397730238375565449, 5228233855704101657
Offset: 2

Views

Author

Martin Raab, Jun 04 2004

Keywords

Examples

			Example for n=10: 1,19,197,1979,19793,197933,1979339,19793393,197933933 and 1979339339 are all prime numbers.
		

Crossrefs

Cf. A023107 (where 1 is not considered to be prime).

Programs

  • PARI
    a(n) = my(S,m,D); D=select(x->(gcd(x,n)==1),vector(n-1,j,j)); S=concat([1],select(ispseudoprime,vector(n,j,j))); while(#S, m=vecmax(S); S=concat(vector(#D,j,select(ispseudoprime,vector(#S,i,S[i]*n+D[j]))));); m /* Max Alekseyev, Dec 06 2014 */

A326609 Largest minimal prime in base n (written in base 10).

Original entry on oeis.org

3, 13, 5, 3121, 5209, 2801, 76695841, 811, 66600049, 29156193474041220857161146715104735751776055777, 388177921
Offset: 2

Views

Author

Richard N. Smith, Jul 13 2019

Keywords

Comments

a(13) is (probably) 13^32020*8+183, it has 35670 digits, a(14) = 14^85*4+65, it has 99 digits, a(15) = (15^106*66-619)/7, it has 126 digits, a(16) = 16^3544*9+145, it has 4269 digits.
a(17) is the smallest prime of the form (4105*17^k-9)/16 if it exists, otherwise (probably) (73*17^111333-9)/16 (136991 digits), a(18) = 18^31*304+1 (42 digits).
Other known terms: a(20) = (20^449*16-2809)/19 (585 digits), a(22) = 22^763*20+7041 (1026 digits), a(23) is (probably) (23^800873*106-7)/11 (1090573 digits), a(24) = (24^99*512-121)/23 (138 digits), a(30) = 30^1023*12+1 (1513 digits), a(42) = (42^487*27-1093)/41 (791 digits).
a(19) is the smallest prime of the form (15964*19^k-1)/3 if it exists, otherwise (probably) (904*19^110984-1)/3 (141924 digits), a(21) is the smallest prime of the form 16*21^k+335 if it exists, otherwise (probably) (51*21^479149-1243)/4 (633542 digits).

Crossrefs

Cf. A071062 (base 10 minimal primes), A110600 (base 12 minimal primes).
Cf. A293142 (largest non-repunit permutable prime), A317689 (largest non-repunit circular prime), A103443 (largest left-truncatable prime), A023107 (largest right-truncatable prime), A323137 (largest two-sided prime), A084738 (smallest repunit prime), A186995 (smallest weakly prime).

A358344 a(1) = 0; a(n) = the smallest number such that the concatenation a(1)a(2)...a(n) is prime in the smallest allowed base; sequence terminates at index m if a(1)a(2)...a(m)k is composite in the smallest allowed base for all k.

Original entry on oeis.org

0, 2, 1, 2, 2, 3, 1, 5, 9, 7, 21, 5, 31, 49, 39, 104, 2, 34, 44, 74, 22, 64, 16, 107, 549, 81, 207, 273, 87, 497, 27, 556, 42, 150, 32, 44, 144, 340, 28, 198, 677, 13, 61, 209, 377, 893, 329, 391, 49, 83, 425, 197, 1017, 205, 191, 163, 1131, 291, 281, 295, 389
Offset: 1

Views

Author

Samuel Harkness, Nov 11 2022

Keywords

Comments

For all n > 1, a(n) > 0.
For all n > 3, if a(n) is even or odd, then until a new number a(n+k) > a(n), all a(n+k) must also be even or odd, respectively.
"Smallest allowed base" is max{a(1), a(2), ..., a(n)} + 1. E.g., a(3) uses base 3 because max{0, 2, 1} + 1 = 3.
Treat a(n) >= 10 as one "digit". E.g., if three consecutive terms were 8, 12, 4, treat the concatenation as "8C4" to be read in base 13 instead of "8124."
It is unknown whether this sequence has infinite terms. There exist initial values which, using the method described in the definition, reach a point that guarantees no new primes. E.g., Michael S. Branicky showed for a(1) = 13, after 4 terms {13, 9, 3, 5} the tested number for a fifth term "k" is not prime for 0 <= k < 13, and the equation for the tested number once k >= 13 is 13*(k+1)^4 + 9*(k+1)^3 + 3*(k+1)^2 + 5(k+1) + k = (k+2)(13*k^3 + 35*k^2 + 38*k + 15), thus never prime. Because there exist initial values which guarantee no new terms after various lengths, any initial value may eventually reach such a point.

Examples

			For a(6): The concatenation a(1)a(2)a(3)a(4)a(5) gives 2122. The smallest base in which 2122 can be read is max{2, 1, 2, 2} + 1 = 3, so test 21220_3 = 213 (nonprime), 21221_3 = 214 (nonprime), 21222_3 = 215 (nonprime). Now, 21223 is the next candidate; note that the new smallest allowed base is max{2, 1, 2, 2, 3} + 1 = 4, so test 21223_4 = 619 (prime). Thus, a(6) = 3.
		

Crossrefs

Programs

  • Mathematica
    V = {0}; While[Length[V] <= 60, c = 0; d = 0; b = Max[V] + 1; CCC = 0; While[c == 0, X = V; X = Append[X, d]; CCC = 0; For[i = 1, i <= Length[X], i++, CCC += Part[X, i]*b^(Length[X] - i)]; If[PrimeQ[CCC], c = 1]; d++; If[d == b, b++]]; V = X]; Print[V]
  • Python
    from sympy import isprime
    from itertools import count, islice
    def fd(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
    def anext(alst):
        b = max(alst)
        return next(k for k in count(1) if isprime(fd(alst+[k], max(b, k)+1)))
    def agen():
        alst = [0]
        while True: yield alst[-1]; alst.append(anext(alst))
    print(list(islice(agen(), 61))) # Michael S. Branicky, Nov 11 2022

Extensions

Escape clause added by Jianing Song, Nov 28 2022
Previous Showing 11-16 of 16 results.