login
Right-truncatable primes in base 16.
13

%I #43 Mar 13 2020 08:37:32

%S 2,3,5,7,11,13,37,41,43,47,53,59,61,83,89,113,127,179,181,191,211,223,

%T 593,599,601,607,659,661,691,701,757,761,853,857,859,863,947,953,977,

%U 983,991,1427,1429,1433,1439,1811,1823,2039,2879,2897,2903,2909,3061

%N Right-truncatable primes in base 16.

%C 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]

%C The sequence has 414 nonzero members.

%C 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

%H Stanislav Sykora, <a href="/A237600/b237600.txt">Table of n, a(n) for n = 1..414</a>

%H Stanislav Sykora, <a href="https://oeis.org/wiki/File:GeneticThreads.txt">PARI/GP scripts for genetic threads</a>

%e 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.

%t Select[Range@ 3600, AllTrue[Most[DeleteDuplicates@ FixedPointList[f, #]], PrimeQ] &] (* _Michael De Vlieger_, Mar 07 2015, Version 10 *)

%o (PARI) GT_Trunc1(nmax,prop,b=10) = { \\ See the link for details

%o my (n=0,v=vector(nmax),g=1,lgs=1,lge,an,c);

%o for (k=1,b-1,if (prop(k),v[n++]=k));

%o lge=n; c=lge-lgs+1;

%o while (c, g++;for (k=lgs,lge,for (m=0,b-1, an=b*v[k]+m;

%o if (prop(an), v[n++]=an;if (n>=nmax,return (v)));););

%o lgs=lge+1; lge=n; c=lge-lgs+1;);

%o if (n, return (v[1..n]));

%o print("No solution");}

%o v = GT_Trunc1(1000000,isprime,16)

%o (PARI) isok(n)={ while(n, if(!isprime(n),return(0));n\=16); 1} \\ _Joerg Arndt_, Mar 07 2015

%o (PARI) my(A=primes([0,15]),i=1); until(#A<i+=1, A=concat(A, primes([A[i], A[i]+1]*16))); #A237600=A \\ _M. F. Hasler_, Nov 07 2018

%o (Python)

%o from gmpy2 import is_prime

%o A237600_list = []

%o for n in range(1,10**9):

%o if is_prime(n):

%o s = format(n,'x')

%o for i in range(1,len(s)):

%o if not is_prime(int(s[:-i],16)):

%o break

%o else:

%o A237600_list.append(n) # _Chai Wah Wu_, Apr 16 2015

%o (Python)

%o from sympy import primerange

%o p = lambda x: list(primerange(x,x+16)); A237600 = p(0); i=0

%o while i<len(A237600): A237600+=p(A237600[i]*16); i+=1 # _M. F. Hasler_, Mar 11 2020

%Y Cf. A023107, A024770 (base 10), A237601, A237602, A254756.

%K nonn,base,fini,full,easy,tabf

%O 1,1

%A _Stanislav Sykora_, Feb 15 2014