A099280 2^n-th palindromic number.
1, 2, 4, 8, 77, 232, 555, 2992, 15751, 41314, 92529, 1049401, 3097903, 7193917, 63855836, 227696722, 555373555, 3107337013, 16214541261, 42428982424, 94857775849, 1097153517901, 3194305034913, 7388609068837, 67772177127776
Offset: 0
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..1661
Crossrefs
Cf. A083816.
Programs
-
Mathematica
NextPalindrome[n_] := Block[ {l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[ idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] FromDigits[ Take[ idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[ idn, Ceiling[l/2]], Reverse[ Take[ idn, Floor[l/2]]] ]], idfhn = FromDigits[ Take[ idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]] ]]]]; k = 1; np = 0; Do[ While[np = NextPalindrome[np]; k != 2^n, k++ ]; Print[np], {n, 26}]
-
Python
def A099280(n): if n == 0: return 1 m = 1<
Chai Wah Wu, Jun 13 2024