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.

A082979 Lexicographically earliest rearrangement of primes such that the sum of two consecutive terms is a palindrome.

This page as a plain text file.
%I A082979 #15 Dec 04 2018 17:21:29
%S A082979 2,3,5,17,71,131,101,151,61,181,31,13,53,149,73,139,83,179,23,43,199,
%T A082979 457,7,37,29,59,163,79,173,89,113,109,103,311,547,271,11,191,41,47,19,
%U A082979 193,211,223,241,233,251,557,281,577,5869,137,277,127,307,97,317,107
%N A082979 Lexicographically earliest rearrangement of primes such that the sum of two consecutive terms is a palindrome.
%H A082979 Ivan Neretin, <a href="/A082979/b082979.txt">Table of n, a(n) for n = 1..10000</a>
%t A082979 seq={2}; Do[k=3; While[MemberQ[seq, k] || !PalindromeQ[k+seq[[-1]]], k = NextPrime[k]]; AppendTo[seq, k], {i, 1, 50}]; seq (* _Amiram Eldar_, Dec 04 2018 *)
%o A082979 (PARI)
%o A082979 ispal(n)={my(v=digits(n));for(i=1, #v\2, if(v[i]<>v[#v+1-i], return(0))); 1}
%o A082979 seq(n)={my(v=vector(n), M=Map(), t=0); for(n=1, n, forprime(p=1, oo, if(!mapisdefined(M,p) && ispal(p+t), t=p; break)); mapput(M,t,1); v[n]=t); v} \\ _Andrew Howroyd_, Dec 04 2018
%K A082979 base,nonn,look
%O A082979 1,1
%A A082979 _Jason Earls_, May 28 2003