%I #23 Jan 15 2023 18:07:13
%S 0,0,3,2,0,2,2,2,4,6,2,2,2,2,2,3,8,2,3,3,2,3,2,2,2,2,2,9,2,2,6,2,4,3,
%T 2,3,12,2,6,3,2,2,6,2,2,3,2,2,2,3,2,9,2,2,3,2,2,3,2,4,12,2,2,3,12,3,6,
%U 2,2,3,10,2,6,2,2,3,10,2,26,3,2,27,2,2
%N Smallest base in which n's digital reversal is prime, or 0 if no such base exists.
%C 0 and 1 are not prime and are single digits in all bases, so no reversal of digits can make them prime. a(n) is therefore 0 for both.
%C 4 is not prime and so cannot be prime if reversed in any base where it is a single digit. This leaves bases 2 and 3 where, upon reversal, it is 1 and 4 respectively. Neither are prime, and so a(4) is also 0.
%C Conjecture 1: 0, 1 and 4 are the only values where there is no base in which a digital reversal makes a prime.
%C It is clear that for any prime p, a(p) cannot be zero, since a(p)=p+1 is a solution if there is none smaller.
%C Conjecture 2: n = 2 is the only prime p which must be represented in base p+1, i.e., trivially, as a single digit, in order for its reversal to be prime.
%C Corollary: Since a(n) cannot be n itself -- reversing n in base n obtains 1, which is not prime -- this would mean that for all positive n except 2, a(n) < n.
%C Other than its small magnitude, a(n) = 2 occurs often due to the fact that a reversed positive binary number is guaranteed to be odd and thus stands a greater chance of being prime.
%C Similarly, many solutions exist solely because reversal removes all powers of the base from n, reducing the number of divisors. Thus based solely on observation:
%C Conjecture 3: With the restriction gcd(base,n) = 1, a(n) = 0 except for n = 2, 3 and 6k+-1, for positive integer k, i.e., terms of A038179.
%H Carl R. White, <a href="/A227864/b227864.txt">Table of n, a(n) for n = 0..9999</a>
%e 9 in base 2 is 1001, which when reversed is the same and so not prime. In base 3 it is 100, which becomes 1 when reversed and also not prime. Base 4: 21 -> 12 (6 decimal), not prime; Base 5: 14 -> 41 (21 decimal), not prime; Base 6: 13 -> 31 (19 decimal), which is prime, so a(9) = 6, i.e., 6 is the smallest base in which 9's digital reversal is a prime number.
%o (Python)
%o from sympy import isprime
%o from sympy.ntheory.digits import digits
%o def okb(n, b):
%o return isprime(sum(d*b**i for i, d in enumerate(digits(n, b)[1:])))
%o def a(n):
%o for b in range(2, n+2):
%o if okb(n, b): return b
%o return 0
%o print([a(n) for n in range(84)]) # _Michael S. Branicky_, Sep 06 2021
%Y Cf. A114018, A006567, A095179.
%Y Positions of 2's: A204232.
%K nonn,base,easy
%O 0,3
%A _Carl R. White_, Nov 01 2013
|