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.

A230820 Table, read by antidiagonals, of palindromic primes in base b expressed in decimal.

This page as a plain text file.
%I A230820 #17 Feb 16 2014 19:50:44
%S A230820 3,2,5,2,13,7,2,3,23,17,2,3,5,151,31,2,3,31,17,173,73,2,3,5,41,29,233,
%T A230820 107,2,3,5,7,67,59,757,127,2,3,5,71,37,83,257,937,257,2,3,5,7,107,43,
%U A230820 109,373,1093,313,2,3,5,7,73,157,61,701,409,1249,443
%N A230820 Table, read by antidiagonals, of palindromic primes in base b expressed in decimal.
%e A230820 \r
%e A230820 b\
%e A230820 .2.3...5...7...17...31...73..107..127...257...313...443..1193..1453..1571.=A016041
%e A230820 .3.2..13..23..151..173..233..757..937..1093..1249..1429..1487..1667..1733.=A029971
%e A230820 .4.2...3...5...17...29...59..257..373...409...461...509...787...839...887.=A029972
%e A230820 .5.2...3..31...41...67...83..109..701...911..1091..1171..1277..1327..1667.=A029973
%e A230820 .6.2...3...5....7...37...43...61...67...191...197..1297..1627..1663..1699.=A029974
%e A230820 .7.2...3...5...71..107..157..257..271...307..2549..2647..2801..3347..3697.=A029975
%e A230820 .8.2...3...5....7...73...89...97..113...211...227...251...349...373...463.=A029976
%e A230820 .9.2...3...5....7..109..127..173..191...227...337...373...419...601...619.=A029977
%e A230820 10.2...3...5....7...11..101..131..151...181...191...313...353...373...383.=A002385
%e A230820 11.2...3...5....7..199..277..421..443...499...521...587...643...709...743.=A029978
%e A230820 12.2...3...5....7...11...13..157..181...193...229...241...277...761...773.=A029979
%e A230820 ...
%e A230820 inf..2..3..5..7..11..13..17..19..23..29..31..37..41..43..47..53..59..61...=A000040
%p A230820 A230820 := proc(b,n)
%p A230820     option remember;
%p A230820     local a,dgs ;
%p A230820     if n = 1 then
%p A230820         if b = 2 then
%p A230820             return 3;
%p A230820         else
%p A230820             return 2;
%p A230820         end if;
%p A230820     else
%p A230820         for a from procname(b,n-1)+1 do
%p A230820             if isprime(a) then
%p A230820                 ispal := true ;
%p A230820                 dgs := convert(a,base,b) ;
%p A230820                 for i from 1 to nops(dgs)/2 do
%p A230820                     if op(i,dgs) <> op(-i,dgs) then
%p A230820                         ispal := false;
%p A230820                     end if;
%p A230820                 end do:
%p A230820                 if ispal then
%p A230820                     return a;
%p A230820                 end if;
%p A230820             end if;
%p A230820         end do:
%p A230820     end if;
%p A230820 end proc:
%p A230820 for b from 2 to 9 do
%p A230820     for n from 1 to 9 do
%p A230820         printf("%3d ",A230820(b,n)) ;
%p A230820     end do:
%p A230820     printf("\n") ;
%p A230820 end do; # _R. J. Mathar_, Feb 16 2014
%t A230820 palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[ n, base]}, idn == Reverse@ idn]; Table[Select[Prime@Range@500, palQ[#, k + 1] &][[b - k + 1]], {b, 11}, {k, b, 1, -1}] // Flatten
%Y A230820 Cf. A000040, A016041, A029971, A029972, A029973, A029974, A029975, A029976, A029977, A002385, A029978, A029979, A029980, A029981, A029982, A029732, A182231.
%K A230820 nonn,base,easy,tabl
%O A230820 1,1
%A A230820 _Robert G. Wilson v_, Oct 30 2013