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.

A219250 Lexicographically earliest sequence of nonnegative integers such that the absolute difference of any two adjacent digits is prime.

This page as a plain text file.
%I A219250 #17 Dec 23 2024 14:53:43
%S A219250 0,2,4,1,3,5,7,9,6,8,13,14,16,18,30,20,24,25,27,29,41,31,35,36,38,50,
%T A219250 52,42,46,47,49,61,63,53,57,58,64,68,69,70,72,74,75,79,202,92,94,96,
%U A219250 81,83,85,86,97,203,130,205,207,241,302,413,131,303,135,242,414,136,138,141,305,246,142,416,146,147,247,249
%N A219250 Lexicographically earliest sequence of nonnegative integers such that the absolute difference of any two adjacent digits is prime.
%C A219250 See A219249 for the version allowing only positive integers, i.e., starting with a(1)=1.
%C A219250 See A219248 (= range of A219250) for the numbers which occur in this sequence, and A219251 for the complement.
%C A219250 A182177 is the analog of this sequence for replacing "absolute difference" by "sum", A182178 is the same analog for A219249; A182175 is the analog of A219248 and A219110 corresponds to A219251.
%H A219250 M. F. Hasler in reply to E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2013-April/011036.html">Re: Any digit-pair in S sums to a prime</a>, SeqFan list, Apr 11 2013
%o A219250 (PARI) {(n,a=[0],u=0)->while(#a<n,u+=1<<a[#a];for(t=a[1]+1,9e9,bittest(u,t)&next;my(d=concat(a[#a]%10,digits(t)));for(i=2,#d,isprime(abs(d[i-1]-d[i]))||next(2));a=concat(a,t);break));a}
%K A219250 nonn,base
%O A219250 1,2
%A A219250 _M. F. Hasler_, Apr 11 2013