A099280
2^n-th palindromic number.
Original entry on oeis.org
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
-
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}]
-
def A099280(n):
if n == 0: return 1
m = 1<Chai Wah Wu, Jun 13 2024
A103404
The 10^n-th palindromic prime.
Original entry on oeis.org
2, 191, 94049, 114232411, 13649694631, 1565887885651, 175606737606571, 19508150605180591
Offset: 0
2, 3, 5, 7, 11, 101, 131, 151, 181 and 191 are the first ten palindromic primes.
-
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]]]] ]]]];
pal = 0; Do[pal = NextPalindrome[pal]; Do[While[pal = NextPalindrome[pal]; ! PrimeQ[pal], ], {i, 10^(n - 1) + 1, 10^n}]; Print[pal], {n, 0, 8}]
A171226
9+10^n+9*100^n.
Original entry on oeis.org
19, 919, 90109, 9001009, 900010009, 90000100009, 9000001000009, 900000010000009, 90000000100000009, 9000000001000000009, 900000000010000000009, 90000000000100000000009, 9000000000001000000000009, 900000000000010000000000009, 90000000000000100000000000009
Offset: 0
-
A171226:=n->9+10^n+9*100^n; seq(A171226(n), n=0..20); # Wesley Ivan Hurt, Mar 07 2014
-
LinearRecurrence[{111,-1110,1000},{19,919,90109},20] (* Harvey P. Dale, Oct 24 2011 *)
-
a(n) = 9+10^n+9*100^n; \\ Michel Marcus, Mar 08 2014
A373448
10^n-th binary palindrome.
Original entry on oeis.org
0, 27, 2313, 249903, 24183069, 2258634081, 249410097687, 24350854001805, 2229543293296319, 248640535848971067, 24502928886295666773, 2255382216082613264687, 247524358984342778844555, 24637651997205933916917957, 2280497169597819727642768343, 246037303364254649637740936547
Offset: 0
-
a(n) = A006995(10^n); \\ using A006995 PARI program; Michel Marcus, Jun 16 2024
-
def A373448(n):
if n == 0: return 0
k = 10**n
a = 1<<(l:=k.bit_length()-2)
m = a|(k&a-1)
return (m<
A103405
The 2^n-th palindromic prime.
Original entry on oeis.org
2, 3, 7, 151, 757, 14341, 36563, 1114111, 1793971, 7256527, 115737511, 188646881, 746676647, 11984748911, 19541414591, 75174747157, 1192238322911, 1901840481091, 7382419142837, 115344262443511, 181836161638181
Offset: 1
2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727 and 757 are the first sixteen palindromic primes.
-
NextPalindrome[n_] := Block[ {lg = Floor@ Log[10, n] + 1, idn = IntegerDigits@ n}, If[ Union@ idn == {9}, Return[n + 2], If[lg < 2, Return[n + 1], If[ FromDigits@ Reverse@ Take[ idn, Ceiling[lg/2]] > FromDigits@ Take[ idn, -Ceiling[lg/2]], FromDigits@ Join[ Take[ idn, Ceiling[lg/2]], Reverse@ Take[ idn, Floor[lg/2]]], idfhn = FromDigits@ Take[ idn, Ceiling[lg/2]] + 1; idp = FromDigits@ Join[ IntegerDigits@ idfhn, Drop[ Reverse@ IntegerDigits@ idfhn, Mod[lg, 2]]] ]]]];
c = 0; pal = 0; Do[ While[c < 2^n, pal = NextPalindrome@ pal; If[ PrimeQ@ pal, c++ ]]; Print@ pal, {n, 0, 20}]
A171227
Numbers k such that 9 + 10^k + 9*100^k is prime.
Original entry on oeis.org
0, 1, 4, 17, 26, 28, 47, 70, 91, 1129, 4334, 12347, 20212
Offset: 1
19, 919, 900010009 are prime so that 0, 1 and 4 are terms.
Showing 1-6 of 6 results.
Comments