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.

A218343 a(n) is the largest n-digit palindromic integer surrounded by twin primes, if one exists, or 0 otherwise.

This page as a plain text file.
%I A218343 #15 Oct 29 2012 12:20:11
%S A218343 6,0,858,2112,89898,276672,8916198,89522598,898373898,8998558998,
%T A218343 89984248998,899931139998,8999867689998,89999400499998,
%U A218343 899998808899998,8999950220599998,89999961316999998,899999985589999998,8999999741479999998,89999993611639999998
%N A218343 a(n) is the largest n-digit palindromic integer surrounded by twin primes, if one exists, or 0 otherwise.
%H A218343 The prime puzzles, <a href="http://www.primepuzzles.net/puzzles/puzz_659.htm">Puzzle 659</a>
%o A218343 (PARI) a(n)=my(p,t,v,k,j,d,N=n-1);if(n==1,6,if(n==2,0,t=9*10^(N\2);d=6*11^(N%2);forstep(k=t,0,-1,v=digits(k);v=concat(v,vecextract(Vecrev(v),concat(Str((N+1)%2+1),"..")));p=subst(Pol(v),x,10);if(p%d==0&&ispseudoprime(p+1)&&ispseudoprime(p-1),return(p)))))
%K A218343 nonn,base
%O A218343 1,1
%A A218343 _Igor Schein_, Oct 26 2012