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.

A105581 Primes whose indices are palindromic.

This page as a plain text file.
%I A105581 #11 Nov 24 2022 14:40:49
%S A105581 2,3,5,7,11,13,17,19,23,31,79,137,193,257,317,389,457,523,547,607,661,
%T A105581 739,811,877,947,1019,1087,1153,1231,1301,1399,1459,1531,1601,1667,
%U A105581 1747,1831,1907,1999,2081,2141,2239,2309,2381,2447,2549,2647,2699,2777,2851
%N A105581 Primes whose indices are palindromic.
%e A105581 prime(22) = 79 prime(33) = 137 the 11th and 12th entries.
%t A105581 Prime[#]&/@Select[Range[500],PalindromeQ] (* _Harvey P. Dale_, Nov 24 2022 *)
%o A105581 (PARI) g(n) = for(x=1,n,if(ispal(x),print1(prime(x)","))) ispal(n) = { local(len,s1,s2); n=Str(n); len=length(n)\2; s1 = left(n,len); s2 = right(n,len); if(s1 == rev(s2),return(1),return(0)) } left(str,n) = \ Get the left n characters from string str. { local(v,tmp,x); v =""; tmp = Vec(str); ln=length(tmp); if(n > ln,n=ln); for(x=1,n, v=concat(v,tmp[x]); ); return(v) } right(str,n) = \ Get the right n characters from string str. { local(v,ln,s,x); v =""; tmp = Vec(str); ln=length(tmp); if(n > ln,n=ln); s = ln-n+1; for(x=s,ln, v=concat(v,tmp[x]); ); return(v) } rev(str) = \ Get the reverse of the input string { local(tmp,s,j); tmp = Vec(Str(str)); s=""; forstep(j=length(tmp),1,-1, s=concat(s,tmp[j])); return(s) }
%Y A105581 Cf. A258433.
%K A105581 easy,nonn,base
%O A105581 1,1
%A A105581 _Cino Hilliard_, May 03 2005