cp's OEIS Frontend

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.

Showing 1-6 of 6 results.

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

Views

Author

Robert G. Wilson v, Oct 04 2004

Keywords

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

A103404 The 10^n-th palindromic prime.

Original entry on oeis.org

2, 191, 94049, 114232411, 13649694631, 1565887885651, 175606737606571, 19508150605180591
Offset: 0

Views

Author

Robert G. Wilson v, Feb 03 2005

Keywords

Examples

			2, 3, 5, 7, 11, 101, 131, 151, 181 and 191 are the first ten palindromic primes.
		

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]]]] ]]]];
    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}]

Extensions

a(7) from Donovan Johnson, Aug 25 2012

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

Views

Author

Jason Earls, Dec 05 2009

Keywords

Crossrefs

Cf. A083816.

Programs

Formula

a(n) = 111*a(n-1) -1110*a(n-2) +1000*a(n-3).
G.f.: -(19-1190*x+9190*x^2)/((x-1) * (100*x-1) * (10*x-1)). - R. J. Mathar, Feb 14 2010

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

Views

Author

Chai Wah Wu, Jun 14 2024

Keywords

Comments

a(n) = A006995(10^n).

Crossrefs

Programs

  • PARI
    a(n) = A006995(10^n); \\ using A006995 PARI program; Michel Marcus, Jun 16 2024
  • Python
    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

Views

Author

Robert G. Wilson v, Feb 04 2005, corrected Nov 16 2006

Keywords

Examples

			2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727 and 757 are the first sixteen palindromic primes.
		

Crossrefs

Cf. A083816.

Programs

  • Mathematica
    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

Views

Author

Jason Earls, Dec 05 2009

Keywords

Comments

No more terms up to k = 4100.

Examples

			19, 919, 900010009 are prime so that 0, 1 and 4 are terms.
		

Crossrefs

Cf. A083816.

Programs

Extensions

a(11)-a(12) from Michael S. Branicky, Jun 22 2023
a(13) from Michael S. Branicky, Nov 01 2024
Showing 1-6 of 6 results.