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.

A059004 Smallest prime whose reversal is an n-th power.

This page as a plain text file.
%I A059004 #6 May 22 2019 05:45:37
%S A059004 2,61,521,61,23,61277761,821,61277761,23888027348153,4201,
%T A059004 33670369817243,61277761,5265674839116110941,441435249928911950281,
%U A059004 23888027348153,1232787935486158110509626783,270131
%N A059004 Smallest prime whose reversal is an n-th power.
%H A059004 Robert Israel, <a href="/A059004/b059004.txt">Table of n, a(n) for n = 1..271</a>
%p A059004 revdigs:= proc(n) local L,k;
%p A059004   L:= convert(n,base,10);
%p A059004   add(L[-k]*10^(k-1),k=1..nops(L))
%p A059004 end proc:
%p A059004 f:= proc(n) local d, k, wmin,  v,w;
%p A059004   wmin:= infinity;
%p A059004   for d from 1 do
%p A059004     for k from ceil(10^(d/n)) do
%p A059004       v:= k^n;
%p A059004       if v >= 10^(d+1) then break fi;
%p A059004       w:= revdigs(v);
%p A059004       if isprime(w) and w < wmin then wmin:= w fi;
%p A059004     od;
%p A059004     if wmin < infinity then return wmin fi
%p A059004   od
%p A059004 end proc:
%p A059004 map(f, [$1..20]); # _Robert Israel_, May 22 2019
%t A059004 Do[ k = 1; While[ r = ToExpression[ StringReverse[ ToString[ k^n ] ] ]; ! PrimeQ[ r ], k++ ]; Print[ r ], {n, 1, 25} ]
%Y A059004 Cf. A007488.
%K A059004 nonn,base
%O A059004 1,1
%A A059004 _Robert G. Wilson v_, Jan 16 2001