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.

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