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.

A046942 Numbers k such that k and prime(k) are both palindromes.

Original entry on oeis.org

1, 2, 3, 4, 5, 8114118, 535252535, 4025062605204
Offset: 1

Views

Author

Keywords

Comments

Previous name: Indices of primes appearing in A046941.
Also, intersection of A002113 and A075807. - Ivan Neretin, Jun 02 2016

Crossrefs

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]]]] ]]]];
    p = 0; Do[p = NextPalindrome[p]; While[ !PrimeQ[p], p = NextPalindrome[ p]]; q = IntegerDigits[ PrimePi[ p]]; If[Reverse[q] == q, Print[{p, FromDigits[q]}]], {n, 10^4}] (* Robert G. Wilson v, Feb 03 2005 *)
    ParallelDo[If [PalindromeQ @ i && PalindromeQ @ Prime @i, Print @i], {i, 6*10^8}] (* Mikk Heidemaa, May 24 2024 *)

Extensions

a(7) from Giovanni Resta, May 14 2003
New name and offset by Ivan Neretin, Jun 02 2016
a(8) from Giovanni Resta, Aug 10 2019

A046941 Palindromic primes whose indices n are also palindromes.

Original entry on oeis.org

2, 3, 5, 7, 11, 143787341, 11853735811, 126537757735621
Offset: 1

Views

Author

Keywords

Crossrefs

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]]]] ]]]];
    p = 0; Do[p = NextPalindrome[p]; While[ !PrimeQ[p], p = NextPalindrome[ p]]; q = IntegerDigits[ PrimePi[ p]]; If[Reverse[q] == q, Print[{p, FromDigits[q]}]], {n, 10^4}] (* Robert G. Wilson v, Feb 03 2005 *)
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {}; Do[p = Prime[i]; If[palQ[i] && palQ[p], AppendTo[t, p]], {i, 9*10^6}]; t (* Jayanta Basu, Jun 23 2013 *)
  • PARI
    ispal(n) = my(d=digits(n)); d == Vecrev(d);
    isok(p) = isprime(p) && ispal(p) && ispal(primepi(p)); \\ Michel Marcus, Jan 27 2019

Formula

a(n) = prime(A046942(n)).

Extensions

a(7) from Giovanni Resta, May 14 2003
a(8) from Giovanni Resta, Aug 10 2019

A103358 Palindromes q derived from palindromes p such that pi(p) = q.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 4, 5, 8, 11, 55, 66, 77, 99, 99, 101, 121, 141, 151, 161, 303, 525, 757, 797, 1551, 2222, 4114, 4334, 4884, 5995, 6336, 8008, 9119, 9229, 22222, 33433, 48684, 53735, 54645, 55555, 56465, 61316, 64046, 72027, 72727, 84548, 89998
Offset: 1

Views

Author

Zak Seidov, Feb 02 2005

Keywords

Crossrefs

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]]]] ]]]];
    p = 0; a = {}; Do[p = NextPalindrome[ p]; q = IntegerDigits[ PrimePi[ p]]; If[ Reverse[q] == q, Print[{p, FromDigits[q]}]; AppendTo[a, p]], {n, 10^4}]; PrimePi[a] (* Robert G. Wilson v, Feb 03 2005 *)

Extensions

More terms from Robert G. Wilson v, Feb 03 2005

A103402 Palindromes p such that pi(p) is a palindromic prime.

Original entry on oeis.org

3, 4, 5, 6, 11, 33, 555, 878, 5775, 6116, 919919, 58633685, 129707921, 16958285961, 867275572768, 50166722766105, 310439747934013, 4384495885944834, 5817988338897185
Offset: 1

Views

Author

Robert G. Wilson v, Feb 03 2005

Keywords

Comments

From a suggestion from Zak Seidov, Feb 02 2005.
a(16) > 32*10^12. - Donovan Johnson, Dec 03 2009

Crossrefs

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]]]] ]]]];
    p = 0; a = {}; Do[p = NextPalindrome[p]; q = PrimePi[p]; If[PrimeQ[q], r = IntegerDigits[q]; If[Reverse[r] == r, Print[{p, q}]; AppendTo[a, p]]], {n, 10^6}]; a
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {}; Do[If[palQ[n] && PrimeQ[x = PrimePi[n]] && palQ[x], AppendTo[t, n]], {n,10^6}]; t (* Jayanta Basu, Jun 24 2013 *)

Extensions

a(15) from Donovan Johnson, Dec 03 2009
a(16)-a(17) from Chai Wah Wu, Sep 04 2019
a(18)-a(19) from Giovanni Resta, Sep 12 2019

A103403 Palindromic primes q derived from palindromes p such that pi(p) = q.

Original entry on oeis.org

2, 2, 3, 3, 5, 11, 101, 151, 757, 797, 72727, 3485843, 7362637, 753535357, 32792329723, 1644209024461, 9600458540069, 125319848913521, 164957666759461
Offset: 1

Views

Author

Robert G. Wilson v, Feb 03 2005

Keywords

Comments

From a suggestion from Zak Seidov, Feb 02 2005.
a(16) > pi(32*10^12). - Donovan Johnson, Dec 03 2009

Crossrefs

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]]]] ]]]];
    p = 0; a = {}; Do[p = NextPalindrome[p]; q = PrimePi[p]; If[PrimeQ[q], r = IntegerDigits[q]; If[Reverse[r] == r, Print[{p, q}]; AppendTo[a, q]]], {n, 10^6}]; a
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {}; Do[If[palQ[n] && PrimeQ[y = PrimePi[n]] && palQ[y], AppendTo[t, y]], {n,10^6}]; t (* Jayanta Basu, Jun 24 2013 *)

Extensions

a(15) from Donovan Johnson, Dec 03 2009
a(16)-a(17) from Chai Wah Wu, Sep 04 2019
a(18)-a(19) from Giovanni Resta, Sep 12 2019

A116056 n and pi(n) are both made of nontrivial runs of identical digits, where pi(n)=A000720(n).

Original entry on oeis.org

33, 8833, 66644, 66777, 117766, 118811, 990000, 1144000, 9997777, 115522333, 116660044, 116661111, 1100088555, 1100088855, 1100111100, 1100111111, 1100111333, 1100112200, 1100112211, 1100112222, 2277334444, 2277334455, 2277334466, 2277334477, 2277335500, 2288811222
Offset: 1

Views

Author

Giovanni Resta, Feb 13 2006

Keywords

Comments

A run of length 1 is trivial.
Up to 10^18 there are only 5 prime terms: 9997777, 1122991155533399, 44770077777722233, 440009996622997711, 442244499338866333. - Giovanni Resta, Sep 13 2019

Examples

			pi(118811) = 11199, pi(9997777) = 664444.
		

Crossrefs

Programs

  • Mathematica
    zyQ[n_] := Min[Length /@ Split[IntegerDigits[n]]] > 1; Select[Range[10^7], zyQ[#] && zyQ[PrimePi[#]] &] (* Giovanni Resta, Sep 13 2019 *)

Extensions

More terms from Giovanni Resta, Sep 13 2019
Showing 1-6 of 6 results.