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.

A028989 Smallest palindromic prime with 2n-1 digits.

This page as a plain text file.
%I A028989 #30 Jul 07 2024 20:54:03
%S A028989 2,101,10301,1003001,100030001,10000500001,1000008000001,
%T A028989 100000323000001,10000000500000001,1000000008000000001,
%U A028989 100000000212000000001,10000000000300000000001,1000000000016100000000001,100000000000080000000000001,10000000000000300000000000001
%N A028989 Smallest palindromic prime with 2n-1 digits.
%H A028989 Charles R Greathouse IV, <a href="/A028989/b028989.txt">Table of n, a(n) for n = 1..500</a>
%H A028989 Patrick De Geest, <a href="http://www.worldofnumbers.com/palpri.htm">World!Of Palindromic Primes</a>.
%t A028989 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 *)
%o A028989 (PARI) a(n)={
%o A028989 n--;
%o A028989 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);
%o A028989 forstep(a=N,N+9*aS,aS,
%o A028989 forstep(b=a,a+9*bS,bS,
%o A028989 forstep(c=b,b+9*cS,cS,
%o A028989 forstep(d=c,c+9*dS,dS,
%o A028989 if(ispseudoprime(d),return(d))
%o A028989 ))));
%o A028989 warning("could not find a("n")")
%o A028989 }; \\ _Charles R Greathouse IV_, Feb 15 2011
%o A028989 (PARI) a(n)=for(j=10^(n-1),10^n-1,d=digits(j);p=fromdigits(vector(2*n-1,x,if(x<n,d[x],d[2*n-x])));ispseudoprime(p)&&return(p));0 \\ _Jeppe Stig Nielsen_, Feb 20 2021
%Y A028989 Odd-numbered terms of A056732. - _Edward Catmur_, May 01 2015
%Y A028989 Cf. A100027.
%K A028989 nonn,base
%O A028989 1,1
%A A028989 _Patrick De Geest_
%E A028989 a(10) corrected by _Farideh Firoozbakht_, Oct 10 2005