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.
%I A386929 #16 Aug 14 2025 09:12:55 %S A386929 0,3,2,3,2,5,4,5,6,3,4,9,4,0,6,5,4,0,4,0,5,3,2,0,6,5,6,5,4,0,7,0,5,3, %T A386929 8,0,4,7,6,0,5,0,4,0,6,3,2,9,8,7,0,7,4,0,4,5,8,3,7,0,4,0,5,9,8,9,3,5, %U A386929 0,0,4,0,4,0,8,0,4,0,3,0,5,9,4,9,7,0,6,9,2,0,4,0,6,3,8 %N A386929 a(n) is the least base b in {2,...,10} such that the base-b expansion of n, when read as a decimal integer, is prime; a(n) = 0 if no such base exists. %C A386929 There are infinitely many zeros since if n is a multiple of 2520, then each base-b expansion ends with digit 0. %F A386929 a(2520*n) = 0. %e A386929 a(10) = 3 since 10 in base 3 is "101" and 101 is prime; base 2 is "1010" -> 1010 composite. %e A386929 a(11) = 4 since base 4 gives "23" -> 23 is prime; base 2 "1011" -> 1011 composite; base 3 "102" -> 102 composite. %e A386929 a(23) = 2 since base 2 gives "10111" -> 10111 is prime. %t A386929 a[n_] := Block[{m}, Do[m = FromDigits[IntegerDigits[n, b], 10]; If[PrimeQ[m], Return[b]], {b, 2, 10}]; 0] %o A386929 (PARI) a(n) = for(b=2, 10, if (isprime(fromdigits(digits(n, b))), return(b))); \\ _Michel Marcus_, Aug 09 2025 %Y A386929 Cf. A038537, A052026 (the zeros), A052033 (the tens). %K A386929 nonn,base %O A386929 1,2 %A A386929 _Pietro Tiaraju Giavarina dos Santos_, Aug 08 2025