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 10 results.

A237600 Right-truncatable primes in base 16.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 37, 41, 43, 47, 53, 59, 61, 83, 89, 113, 127, 179, 181, 191, 211, 223, 593, 599, 601, 607, 659, 661, 691, 701, 757, 761, 853, 857, 859, 863, 947, 953, 977, 983, 991, 1427, 1429, 1433, 1439, 1811, 1823, 2039, 2879, 2897, 2903, 2909, 3061
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2014

Keywords

Comments

Numbers with these properties: (i) a(n) is a prime and (ii) its image under the function E(k) = k\16 = floor(k/16) is zero or has the same properties. [Corrected by M. F. Hasler, Nov 07 2018]
The sequence has 414 nonzero members.
Otherwise said, integers p > 0 such that floor(p/16^k) is prime or zero for all k >= 0. One might relax to p >= 0, i.e., include an initial term 0, corresponding to an empty string of digits. The recursive definition can also be used to produce all of the terms, starting with the primes < 16, and adding, for each term of the list, the primes made from appending a digit to that term, i.e., the primes between 16 x that term and 16 more. The sequence can also be seen as a table whose n-th row yields the terms with n digits in base 16: row lengths are A237601 and the last term of row n is A237602(n). - M. F. Hasler, Nov 07 2018

Examples

			a(414) = 16778492037124607, in hexadecimal notation 3B9BF319BD51FF, belongs to a(n) because each of its hexadecimal prefixes (including itself) is a prime. Being the largest of such numbers, it is also a member of A023107.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 3600, AllTrue[Most[DeleteDuplicates@ FixedPointList[f, #]], PrimeQ] &] (* Michael De Vlieger, Mar 07 2015, Version 10 *)
  • PARI
    GT_Trunc1(nmax,prop,b=10) = { \\ See the link for details
      my (n=0,v=vector(nmax),g=1,lgs=1,lge,an,c);
      for (k=1,b-1,if (prop(k),v[n++]=k));
      lge=n; c=lge-lgs+1;
      while (c, g++;for (k=lgs,lge,for (m=0,b-1, an=b*v[k]+m;
        if (prop(an), v[n++]=an;if (n>=nmax,return (v)));););
        lgs=lge+1; lge=n; c=lge-lgs+1;);
      if (n, return (v[1..n]));
      print("No solution");}
    v = GT_Trunc1(1000000,isprime,16)
    
  • PARI
    isok(n)={ while(n, if(!isprime(n),return(0));n\=16); 1} \\ Joerg Arndt, Mar 07 2015
    
  • PARI
    my(A=primes([0,15]),i=1); until(#AA237600=A \\ M. F. Hasler, Nov 07 2018
    
  • Python
    from gmpy2 import is_prime
    A237600_list = []
    for n in range(1,10**9):
        if is_prime(n):
            s = format(n,'x')
            for i in range(1,len(s)):
                if not is_prime(int(s[:-i],16)):
                    break
            else:
                A237600_list.append(n) # Chai Wah Wu, Apr 16 2015
    
  • Python
    from sympy import primerange
    p = lambda x: list(primerange(x,x+16)); A237600 = p(0); i=0
    while iA237600): A237600+=p(A237600[i]*16); 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.

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.

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