A191350 The number of bases not exceeding n+1 in which the expansion of n (i) has only digits <=9 and (ii) represents a prime if digits are concatenated/reinterpreted as decimals.
1, 2, 1, 3, 1, 3, 2, 2, 3, 3, 2, 4, 2, 4, 4, 5, 3, 7, 4, 6, 6, 8, 4, 7, 5, 6, 6, 8, 4, 9, 4, 9, 7, 7, 4, 11, 5, 9, 6, 8, 4, 13, 4, 8, 7, 10, 5, 10, 5, 8, 7, 9, 4, 14, 5, 8, 8, 11, 4, 12, 4, 10, 8, 8, 5, 15, 6, 8, 6, 13, 4, 14, 5, 10, 6, 8, 6, 17, 5, 8, 7, 12, 6, 13, 5, 11, 8, 11, 4, 15, 5
Offset: 2
Examples
In bases 6, 8, 12 and 14 the digits of n=15 are 15_6=23, 15_8=17, 15_12=13, and 15_14=11. Since in other bases<=16 the expansions of 15 converted to decimal are not primes, a(15)=4.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
Programs
-
PARI
a(n)=my(m,t,k,i);sum(b=2,n+1,k=n;m=0;i=0;while(k,t=k%b;if(t>9,m=0;break);m+=10^i*t;i++;k\=b);isprime(m)) \\ Charles R Greathouse IV, Jun 01 2011
Extensions
a(16)-a(91) from Charles R Greathouse IV, Jun 01 2011