login
Smallest palindromic number >= 2^n.
2

%I #16 Jun 12 2023 17:06:38

%S 1,2,4,8,22,33,66,131,262,515,1111,2112,4114,8228,16461,32823,65556,

%T 131131,262262,524425,1049401,2097902,4194914,8388838,16777761,

%U 33555533,67111176,134222431,268444862,536878635,1073773701,2147557412,4294994924,8589999858,17179897171

%N Smallest palindromic number >= 2^n.

%H Chai Wah Wu, <a href="/A333016/b333016.txt">Table of n, a(n) for n = 0..3321</a>

%F a(n) = A262038(A000079(n)). - _Michel Marcus_, May 04 2020

%e a(10) = 1111, because 2^10 = 1024 and 1111 is the smallest palindromic number >= 1024.

%t spn[n_]:=Module[{k=2^n},While[!PalindromeQ[k],k++];k]; Array[spn,40,0] (* _Harvey P. Dale_, Jun 12 2023 *)

%o (PARI) a(n) = for(k=2^n, oo, if(Vecrev(v=digits(k))==v, return(k))); \\ _Jinyuan Wang_, Mar 05 2020

%Y Cf. A000079, A002113, A262038, A333770.

%K nonn,base

%O 0,2

%A _Eder Vanzei_, Mar 05 2020

%E a(9) corrected by and more terms from _Jinyuan Wang_, Mar 05 2020