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 A338295 #35 Dec 16 2020 17:42:14 %S A338295 1,2,2,2,3,3,4,3,5,2,6,4,7,5,8,3,9,3,10,7,11,5,12,5,13,9,14,4,15,6,16, %T A338295 11,17,7,18,2,19,13,20,2,21,7,22,15,23,7,24,7,25,17,26,4,27,11,28,19, %U A338295 29,8,30,8,31,21,32,13,33,6,34,23,35,6 %N A338295 For n > 1, a(n) is the largest base b <= n such that the digits of n in base b contain the digit b-1; a(1) = 1. %C A338295 The choice b <= n in the name of this sequence comes from the fact that base n+1 has the desired property for all n > 1. %C A338295 For n > 2, a(n) <= (n+1)/2. %H A338295 François Marques, <a href="/A338295/b338295.txt">Table of n, a(n) for n = 1..10000</a> %F A338295 a(n) = (n + 1)/lpf(n + 1) if n + 1 is composite, where lpf(n) is the least prime dividing n, A020639. - _Devansh Singh_, Dec 06 2020 %e A338295 a(7) = 4, since 7 = 13_4 so containing the digit 3, and 7 = 12_5 = 11_6 = 10_7. %e A338295 a(10) = 2, since 10 = 1010_2 so containing the digit 1, and this does not happen for bases between 3 and 10 (i.e., 10 is in the sequence A337536). %t A338295 baseQ[n_, b_] := MemberQ[IntegerDigits[n, b], b - 1]; a[1] = 1; a[n_] := Select[Range[n, 2, -1], baseQ[n, #] &, 1][[1]]; Array[a, 100] (* _Amiram Eldar_, Oct 21 2020 *) %o A338295 (PARI) a(n) = if (n==1, return (1)); my(b=ceil((n+1)/2)); while(vecmax(digits(n, b))<b-1, b--); b; %Y A338295 Cf. A337496, A337535, A020639. %K A338295 nonn,base,easy %O A338295 1,2 %A A338295 _François Marques_, Oct 21 2020