A249634 Least number k that is a palindrome in base n but no bases less than n, or 0 if no such k exists.
0, 1, 2, 25, 6, 14, 32, 54, 30, 11, 84, 39, 140, 75, 176, 102, 198, 19, 220, 147, 110, 69, 384, 175, 416, 486, 420, 58, 570, 279, 544, 429, 306, 245, 684, 296, 380, 663, 880, 615, 1134, 258, 1012, 1035, 1104, 47, 1392, 539, 1500, 1071, 1508, 53, 2106, 935, 1736, 1311, 1798, 413, 2940, 671
Offset: 1
Examples
a(6) = 14 because 14_10 equals 22_6. And 14 is the least integer whose representation in base 6 yields a palindrome as its first palindrome. 7, though palindromic in base 6, is also palindromic in a base less than 6 (7_10 = 111_2 = 11_6) so 7 cannot be a(6).
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..1000
- Math Pages, On General Palindromic Numbers
Crossrefs
Cf. A016026.
Programs
-
Maple
N:= 100: # to get a(1) to a(N) ispali:= proc(k,b) local L; L:= convert(k,base,b); L = ListTools:-Reverse(L); end proc: Needed:= N-1: for k from 1 while Needed > 0 do for b from 2 to N while not ispali(k,b) do od: if b <= N and not assigned(A[b]) then A[b]:= k; Needed:= Needed - 1 fi od: 0, seq(A[n],n=1..N); # Robert Israel, Nov 04 2014
-
Mathematica
f[n_] := Block[{b = 2}, While[ Reverse[idn = IntegerDigits[n, b]] != idn, b++]; b]; a = Array[f, 3000]; Table[ Position[a, n, 1, 1], {n, 2, 60}] // Flatten
-
PARI
a(n)=m=1;while(m,c=0;for(k=2,n-1,D=digits(m,k);if(D==Vecrev(D),c++;break));if(!c&&(d=digits(m,n))==Vecrev(d),return(m));m++) print1(0,", ");for(n=2,100,print1(a(n),", ")) \\ Derek Orr, Nov 02 2014
Comments