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-10 of 12 results. Next

A024770 Right-truncatable primes: every prefix is prime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

Primes in which repeatedly deleting the least significant digit gives a prime at every step until a single-digit prime remains. The sequence ends at a(83) = 73939133 = A023107(10).
The subsequence which consists of the following "chain" of consecutive right truncatable primes: 73939133, 7393913, 739391, 73939, 7393, 739, 73, 7 yields the largest sum, compared with other chains formed from subsets of this sequence: 73939133 + 7393913 + 739391 + 73939 + 7393 + 739 + 73 + 7 = 82154588. - Alexander R. Povolotsky, Jan 22 2008
Can also be seen as a table whose n-th row lists the n-digit terms; row lengths (0 for n >= 9) are given by A050986. The sequence can be constructed starting with the single-digit primes and appending, for each p in the list, the primes within 10*p and 10(p+1), formed by appending a digit to p. - M. F. Hasler, Nov 07 2018

References

  • Roozbeh Hazrat, Mathematica: A Problem-Centered Approach, Springer London 2010, pp. 86-89.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 112-113.

Crossrefs

Supersequence of A085823, A202263. Subsequence of A012883, A068669. - Jaroslav Krizek, Jan 28 2012
Supersequence of A239747.
Cf. A033664, A024785 (left-truncatable primes), A032437, A020994, A052023, A052024, A052025, A050986, A050987, A069866, A077390 (left-and-right-truncatable primes), A137812 (left-or-right truncatable primes), A254751, A254753.
Cf. A237600 for the base-16 analog.

Programs

  • Haskell
    import Data.List (inits)
    a024770 n = a024770_list !! (n-1)
    a024770_list = filter (\x ->
       all (== 1) $ map (a010051 . read) $ tail $ inits $ show x) a038618_list
    -- Reinhard Zumkeller, Nov 01 2011
    
  • Maple
    s:=[1,3,7,9]: a:=[[2],[3],[5],[7]]: l1:=1: l2:=4: do for j from l1 to l2 do for k from 1 to 4 do d:=[s[k],op(a[j])]: 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
  • Mathematica
    max = 100000; truncate[p_] := If[PrimeQ[q = Quotient[p, 10]], q, p]; ok[p_] := FixedPoint[ truncate, p] < 10; p = 1; A024770 = {}; While[ (p = NextPrime[p]) < max, If[ok[p], AppendTo[ A024770, p]]]; A024770 (* Jean-François Alcover, Nov 09 2011, after Pari *)
    eppQ[n_]:=AllTrue[FromDigits/@Table[Take[IntegerDigits[n],i],{i, IntegerLength[ n]-1}], PrimeQ]; Select[Prime[Range[3400]],eppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 14 2015 *)
  • PARI
    {fileO="b024770.txt";v=vector(100);v[1]=2;v[2]=3;v[3]=5;v[4]=7;j=4;j1=1; write(fileO,"1 2");write(fileO,"2 3");write(fileO,"3 5");write(fileO,"4 7"); until(0,if(j1>j,break);new=1;for(i=j1,j,if(new,j1=j+1;new=0);for(k=1,9, z=10*v[i]+k;if(isprime(z),j++;v[j]=z;write(fileO,j," ",z);))));} \\ Harry J. Smith, Sep 20 2008
    
  • PARI
    for(n=2, 31193, v=n; while(isprime(n), c=n; n=(c-lift(Mod(c, 10)))/10); if(n==0, print1(v, ", ")); n=v); \\ Arkadiusz Wesolowski, Mar 20 2014
    
  • PARI
    A024770=vector(9, n, p=concat(apply(t->primes([t, t+1]*10), if(n>1, p)))) \\ The list of n-digit terms, 1 <= n <= 9. Use concat(%) to "flatten" it. - M. F. Hasler, Nov 07 2018
    
  • Python
    from sympy import primerange
    p = lambda x: list(primerange(x, x+10)); A024770 = p(0); i=0
    while iA024770): A024770+=p(A024770[i]*10); i+=1 # M. F. Hasler, Mar 11 2020

A237601 Number of n-digit right-truncatable primes in base 16.

Original entry on oeis.org

6, 16, 37, 60, 74, 77, 63, 39, 22, 11, 5, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2014

Keywords

Comments

See A237600 for a complete list of right-truncatable primes in base 16.

Examples

			a(2)=16 because there are 16 right truncatable hex numbers with two hex digits: 25,29,2B,2F,35,3B,3D,53,59,71,7F,B3,B5,BF,D3,DF.
		

Crossrefs

Cf. A050986 (base 10), A237600, A237602.

Programs

  • PARI
    See the link (use GT_DivMod0 with arguments "isprime" for "property" and 16 for "b").
    
  • PARI
    A237601=vector(15,n,#p=concat(apply(t->primes([t,t+1]*16),if(n>1,p)))) \\ M. F. Hasler, Nov 07 2018

Formula

a(n) = 0 for n >= 15.

A237602 Largest prime with n hexadecimal digits which is a right-truncatable prime in base 16.

Original entry on oeis.org

13, 223, 3583, 57331, 916831, 14669299, 234708791, 3744723967, 59915583473, 958649335571, 14567880621971, 65540984520023, 1048655752320287, 16778492037124607
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2014

Keywords

Comments

See A237600 for a complete list of right-truncatable primes in base 16.
Right-truncatable means that the integer part of successive divisions by 16 yields again primes (or zero). There are no such numbers with more than 14 digits in base 16. - M. F. Hasler, Nov 07 2018

Examples

			The largest right-truncatable prime with 8 hex digits, written in hex notation, is DF33F3FF (in decimal, 3744723967).
		

Crossrefs

Cf. A127890 (base 10), A237600, A237601, A237602.

Programs

  • PARI
    See the link (use GT_DivMod0 with arguments "isprime" for "property" and 16 for "b").
    
  • PARI
    A237602=vector(14, n, p=concat(apply(t->primes([t, t+1]*16), if(n>1,p)));p[#p]) \\ Only the largest term is needed, but we keep all of them since we don't know which will produce "successors". - M. F. Hasler, Nov 07 2018

A238853 Right-truncatable, reversible primes in base 256.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 773, 809, 823
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

See A238850 for definitions, and A238854 for comments on general context.
In base 256, there are 35127 such numbers (see A238855), shown here in decimal format. Base 256 is of interest to programmers because its digits correspond to 8-bit bytes and are easily readable in hexadecimal.

Examples

			The largest such number is 143496996325262301365903209731563 which, written in hex format, with hyphens between bytes for better readability, is 07-13-2F-CD-51-E1-B1-11-EB-23-CD-B3-15-EB. Truncate on the right any number of bytes and the remaining prefix is still a prime, no matter whether the bytes are read from left to right, or vice versa!
		

Crossrefs

Cf. All in base 10: A238850, 16: A238851, 100: A238852.
Cf. In base n: A238854 (largest), A238856 (maximum digits), A238857 (m-digits counts). Cf. A007500, A023107, A024770, A237600, A237601, A237602.

Programs

  • PARI
    See the link.

A238852 Right-truncatable, reversible primes in base 100.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 311, 313, 347, 349, 353, 359, 367, 701, 709, 719, 727, 733, 739, 751, 769, 773, 787, 1103, 1109, 1123, 1163, 1181, 1193, 1301, 1303, 1319, 1321, 1327, 1361, 1777
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

See A238850 for definitions, and A238854 for comments on general context.
In base 100, chosen as one of four examples, there are 1552 such numbers.

Examples

			The largest number of this type (using hyphens to separate the base 100 digits) is 19-07-93-27-17-37-99-47-19-11.Truncate any even number of decimal digits on its right, and the remaining prefix is still a base-100 reversible prime (e.g., 19079327 and 27930719 are both primes).
		

Crossrefs

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

Programs

  • PARI
    See the link.

A238854 Largest right-truncatable, reversible prime in base n.

Original entry on oeis.org

23, 53, 449, 191, 1171, 30671, 5827, 3733, 901687, 10357, 834469, 3043427, 5430889, 4060019, 498061, 34763, 118248433, 62344463, 218555173, 4463351, 114607657, 7903613, 14523874693, 211675817, 32814697, 93375223, 162466979, 8052409793, 12006877873
Offset: 3

Views

Author

Stanislav Sykora, Mar 07 2014

Keywords

Comments

See A238850, A238851, A238852, A238853 for the finite lists of such numbers in four bases selected as examples. A sequence conceptually similar to this one, but for right-truncatable (not reversible!) primes is A023107. The present, more restrictive, condition leads to smaller numbers which can be evaluated in reasonable time for much higher n values.

Examples

			a(4) = 53 because it is a prime which in base 4 reads 311_b4, its reverse 113_b4 (decimal 23) is also a prime, the same holds for all its base-4 prefixes (31_b4 and 3_b4), and it is the largest natural having these properties.
		

Crossrefs

Cf. Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
Cf. In base n: A238855 (totals), A238856 (maximum digits), A238857 (m-digits counts).

Programs

  • PARI
    See the link.

A238855 Number of all right-truncatable reversible primes in base n.

Original entry on oeis.org

0, 3, 4, 12, 5, 12, 24, 17, 16, 33, 22, 29, 50, 39, 40, 39, 24, 65, 80, 100, 58, 58, 69, 122, 101, 90, 83, 125, 114, 133, 114, 122, 255, 203, 252, 123, 152, 221, 202, 308, 131, 250, 299, 397, 303, 143, 201, 484, 497, 423, 269, 253, 442, 944, 845, 378, 231, 460, 420, 455, 538, 438
Offset: 2

Views

Author

Stanislav Sykora, Mar 07 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850.
Conjecture: in any base n, the number of right-truncatable reversible primes is finite.

Examples

			In bases 10, 16, 100, and 256 (used as examples in the crossrefs) there are, respectively, 16, 40, 1552, and 35127 such numbers.
		

Crossrefs

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

Programs

  • PARI
    See the link.

A238856 Number of digits of the largest right-truncatable reversible prime in base n.

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Mar 13 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850. A weak conjecture: this sequence might be bounded.

Examples

			a(16) = 6 because the largest truncatable reversible prime in base 16 has 6 hexadecimal digits (see A238851).
		

Crossrefs

Cf. Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
Cf. In base n: A238854 (largest), A238855 (totals), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238857 Array read by rows: row n lists total number of m-digit right-truncatable reversible primes in base n.

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Mar 13 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850.
This is an irregular table with one line for every base, starting at 2, while the columns correspond to the number of digits (1,2,3,...). Each row terminates with a zero (in any given base there appears to be a finite number of instances).

Examples

			These are the first rows of the table:
   2: 0,
   3: 1, 1, 1, 0,
   4: 2, 1, 1, 0,
   5: 2, 4, 4, 2, 0,
   6: 3, 1, 1, 0,
   7: 3, 5, 3, 1, 0,
   8: 4, 7, 7, 5, 1, 0,
   9: 4, 5, 5, 3, 0,
  10: 4, 5, 6, 1, 0,
  ...
Hence, there are 6 right truncatable reversible primes with 3 digits in base 10 (see A238850).
		

Crossrefs

Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits).

Programs

  • PARI
    See the link.

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.
Showing 1-10 of 12 results. Next