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.

A028989 Smallest palindromic prime with 2n-1 digits.

Original entry on oeis.org

2, 101, 10301, 1003001, 100030001, 10000500001, 1000008000001, 100000323000001, 10000000500000001, 1000000008000000001, 100000000212000000001, 10000000000300000000001, 1000000000016100000000001, 100000000000080000000000001, 10000000000000300000000000001
Offset: 1

Views

Author

Keywords

Crossrefs

Odd-numbered terms of A056732. - Edward Catmur, May 01 2015
Cf. A100027.

Programs

  • Mathematica
    t={}; Do[p=NextPrime[10^(2*n)]; While[Reverse[x=IntegerDigits[p]]!=x,p=NextPrime[p]]; AppendTo[t,p],{n,0,6}]; t (* Jayanta Basu, Jun 05 2013 *)
  • PARI
    a(n)={
    n--;
    my(N=100^n+1,aS=10^(n+3)+10^(n-3),bS=10^(n+2)+10^(n-2),cS=10^(n+1)+10^(n-1),dS=10^n);
    forstep(a=N,N+9*aS,aS,
    forstep(b=a,a+9*bS,bS,
    forstep(c=b,b+9*cS,cS,
    forstep(d=c,c+9*dS,dS,
    if(ispseudoprime(d),return(d))
    ))));
    warning("could not find a("n")")
    }; \\ Charles R Greathouse IV, Feb 15 2011
    
  • PARI
    a(n)=for(j=10^(n-1),10^n-1,d=digits(j);p=fromdigits(vector(2*n-1,x,if(xJeppe Stig Nielsen, Feb 20 2021

Extensions

a(10) corrected by Farideh Firoozbakht, Oct 10 2005

A100026 Consider all (2n+1)-digit palindromic primes of the form 10...0M0...01 (so that M is a palindrome with <= 2n-1 digits); a(n) = smallest such M.

Original entry on oeis.org

0, 3, 3, 3, 5, 8, 323, 5, 8, 212, 3, 161, 8, 3, 242, 3, 8, 10901, 737, 161, 242, 333, 282, 6, 252, 474, 5, 12921, 8, 131, 18381, 6, 444, 6, 797, 606, 717, 15351, 464, 333, 626, 545, 13031, 161, 747, 191, 323, 636, 32523, 303, 282, 888, 686, 18981, 111, 15951, 12021
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com), Nov 20 2004

Keywords

Comments

Is this the same as "Longest palindromic proper substring of A100027(n) or A028989(n+1) that occurs only once in the decimal representation of A100027(n) or A028989(n+1), respectively"? - Felix Fröhlich, Apr 30 2022
A more formal definition may be a(n) = A004151(A028989(n+1) - 10^(2n) - 1) with the convention that A004151(0) = 0. Only in the unlikely situation that A080176 contains undiscovered primes will a(n) = 0 occur for n > 1. - Jeppe Stig Nielsen, Apr 04 2025

Crossrefs

The corresponding palindromic primes are shown in A100027.

Programs

  • Mathematica
    f[n_] := Block[{k = 0, t = Flatten[Join[{1}, Table[0, {n - 1}]]]}, While[s = Drop[t, Min[ -Floor[ Log[10, k]/2], 0]]; k != FromDigits[ Reverse[ IntegerDigits[k]]] || !PrimeQ[ FromDigits[ Join[s, IntegerDigits[k], Reverse[s]]]], k++ ]; k]; Table[ f[n], {n, 56}] (* Robert G. Wilson v, Nov 22 2004 *)

Extensions

More terms from Robert G. Wilson v, Nov 22 2004

A100028 Values of n for which the decimal number 10...030...01 is an n-digit prime.

Original entry on oeis.org

3, 5, 7, 9, 23, 29, 33, 185, 267, 307, 757, 897, 1571, 2977, 3831, 4595, 6573, 9511, 11651, 15641, 68885, 69883
Offset: 1

Views

Author

Harvey Dubner (harvey(AT)dubner.com), Nov 20 2004

Keywords

Examples

			The corresponding primes are 131, 10301, 1003001, 100030001, 10000000000300000000001, etc.
		

Crossrefs

Programs

  • Mathematica
    IntegerLength/@Select[Table[FromDigits[Join[PadRight[{1},n,0],{3},PadLeft[ {1},n,0]]],{n,35000}],PrimeQ] (* Harvey P. Dale, Dec 20 2019 *)

Formula

a(n) = 2*(A171376(n+1))+1. - Chai Wah Wu, Aug 20 2015

A099744 Palindromes n such that 10n01 is a prime.

Original entry on oeis.org

3, 5, 6, 222, 282, 353, 434, 555, 626, 656, 747, 828, 858, 929, 939, 10301, 10601, 11411, 11711, 12821, 12921, 13431, 13731, 14141, 14241, 14741, 15951, 16161, 17171, 17771, 18381, 18981, 19191, 19491, 19991, 20402, 20702, 22022, 22322
Offset: 1

Views

Author

N. J. A. Sloane, Nov 19 2004

Keywords

Crossrefs

Programs

  • Maple
    read transforms; pal:=[]; for n from 0 to 8000 do if digrev(n) = n then pal:=[op(pal),n]; fi; od:
    t0:=[]; u0:=[]; for n from 1 to nops(pal) do m:=pal[n]; p0:="10"; p1:="01"; t1:=cat(p0,m,p1); t1:=convert(t1,decimal,10); if isprime(t1) then t0:=[op(t0),m]; u0:=[op(u0),t1]; fi; od: t0; # u0 gives A099746.
  • Mathematica
    p = Select[ Range[ 22322], # == FromDigits[ Reverse[ IntegerDigits[ # ]]] &]; Select[p, PrimeQ[ FromDigits[ Join[{1, 0}, IntegerDigits[ # ], {0, 1}]]] &] (* Robert G. Wilson v, Nov 20 2004 *)
    Select[Range[23000],PalindromeQ[#]&&PrimeQ[FromDigits[Join[{1,0},IntegerDigits[ #],{0,1}]]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 26 2021 *)

Extensions

More terms from Robert G. Wilson v, Nov 19 2004

A099746 Primes arising in A099744.

Original entry on oeis.org

10301, 10501, 10601, 1022201, 1028201, 1035301, 1043401, 1055501, 1062601, 1065601, 1074701, 1082801, 1085801, 1092901, 1093901, 101030101, 101060101, 101141101, 101171101, 101282101, 101292101, 101343101, 101373101, 101414101
Offset: 1

Views

Author

N. J. A. Sloane, Nov 19 2004

Keywords

Comments

Prompted by Harvey Dubner's Nov 07 2004 discovery that 10000...000M000...00001 with M=3761673, a palindrome, is a 130023-digit palindromic prime.

Crossrefs

Programs

  • Mathematica
    p = Select[ Range[ 22322], # == FromDigits[ Reverse[ IntegerDigits[ # ]]] &]; q = Select[p, PrimeQ[ FromDigits[ Join[{1, 0}, IntegerDigits[ # ], {0, 1}]]] &]; Table[ FromDigits[ Join[{1, 0}, IntegerDigits[ q[[n]]], {0, 1}]], {n, 24}]; (* Robert G. Wilson v, Nov 20 2004 *)

Extensions

More terms from Robert G. Wilson v, Nov 20 2004

A374350 Least n-digit reversible prime whose difference from its reversal is minimal.

Original entry on oeis.org

2, 11, 101, 1231, 10301, 105601, 1003001, 10012001, 100030001, 1007457001, 10000500001, 100124521001, 1000008000001, 10000523500001, 100000323000001, 1000034344300001, 10000000500000001, 100000188981000001, 1000000008000000001, 10000001189110000001, 100000000212000000001
Offset: 1

Views

Author

Robert G. Wilson v, Jul 05 2024

Keywords

Comments

Inspired by A084475 and A373349.
For n > 1, a(2n) has a difference of 9*10^n and a(2n-1) has a difference of 0.

Examples

			a(3) = 101 since its reversal is also 101;
a(4) = 1231 since its reversal is 1321 which is also prime and their difference is minimal at 90;
a(6) = 105601 since its reversal is 106501 which is also prime and their difference is minimal at 900;
a(8) = 10012001 since its reversal is 10021001 which is also prime and their difference is minimal at 9000; etc.
		

Crossrefs

Programs

  • Mathematica
    fe[n_] := Block[{k = 1, j, p, q}, While[ j = k(10^IntegerLength[k]) + IntegerReverse[k +1]; p = 10^(2 n -1) + j(10^(n - IntegerLength[j]/2)) + 1; q = IntegerReverse@ p; !PrimeQ@ p || !PrimeQ@ q, k++; If[ Mod[k, 10] == 9, k++]]; p]; fe[1] = 11;
    fo[n_] := Block[{k = 0, j, p}, While[ j = k(10^(IntegerLength[k] -1)) + IntegerReverse@ Quotient[k, 10]; p = 10^(2n -2) + j(10^(n - (IntegerLength[j] + 1)/2)) +1; !PrimeQ@ p, k++]; p];
    a[n_] := If[ OddQ@ n, fo[(n +1)/2], fe[n/2]]; Array[a, 21]

Formula

a(2n-1) = A100027(n) = A028989(n).
Showing 1-6 of 6 results.