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.

A262254 a(1) = 11; for n>1, a(n) is the smallest prime that starts with the least significant digit of the previous term and has not occurred earlier.

This page as a plain text file.
%I A262254 #35 Nov 17 2015 21:07:57
%S A262254 11,13,31,17,71,19,97,73,37,79,907,701,101,103,307,709,911,107,719,
%T A262254 919,929,937,727,733,311,109,941,113,313,317,739,947,743,331,127,751,
%U A262254 131,137,757,761,139,953,337,769,967,773,347,787,797,7001,149,971,151,157,7013,349,977,7019,983
%N A262254 a(1) = 11; for n>1, a(n) is the smallest prime that starts with the least significant digit of the previous term and has not occurred earlier.
%C A262254 This sequence is different from A089755, as this one does not include single-digit primes.
%C A262254 This sequence is different from A089755, for which a(n+1) uses all the digit of a(n) except the most-significant digit of a(n).
%C A262254 In this sequence, a(n+1) uses only the least-significant digit of a(n).
%H A262254 Maghraoui Abdelkader, <a href="/A262254/b262254.txt">Table of n, a(n) for n = 1..200</a>
%e A262254 a(3) = 31 where the most significant digit of 31 is 3, which is the least significant digit of a(2) = 13.
%t A262254 f[s_List] := Block[{lsd = Mod[s[[-1]], 10], p = 3}, While[ IntegerDigits[p][[1]] != lsd || MemberQ[s, p], p = NextPrime@ p]; Append[s, p]]; s = {11}; s = Nest[f, s, 70] (* _Robert G. Wilson v_, Sep 16 2015 *)
%o A262254 (PARI) msd(n)=(n\10^(#Str(n)-1)); l1=1;l3=1;l7=1;l9=1; q=1; lsd(n)=n%10;
%o A262254 t1 = vector(200); i=1;forprime(n=11,10000, if( digits(n)[1]==1,t1[i]=n; i=i+1 ; )) ;
%o A262254 t3 = vector(130); i=1;forprime(n=31,3900 ,  if( digits(n)[1]==3,t3[i]=n; i=i+1 ; ));
%o A262254 t7 = vector(130); i=1;forprime(n=71,70000, if( digits(n)[1]==7,t7[i]=n; i=i+1 ; )) ;
%o A262254 t9 = vector(130); i=1;forprime(n=97,90000, if( digits(n)[1]==9,t9[i]=n; i=i+1 ; )) ;lsd(n)=n%10;
%o A262254 t = vector(200);
%o A262254 findnextnumber(m) =
%o A262254 {if(lsd(m)==1, l1=t1[i1] ; i1=i1+1;return(l1);); if(lsd(m)==3, l3=t3[i3];  i3=i3+1 ; return(l3););
%o A262254 if(lsd(m)==7, l7=t7[i7] ; i7=i7+1;return(l7);); if(lsd(m)==9, l9=t9[i9];  i9=i9+1;return(l9);); }
%o A262254 i1=1;  i3=1;  i7=1;  i9=1;  j=1;s=11;   for(n=1,200,   p=findnextnumber(s) ; t[j]=p; s=p;j++);for(i=1,200, print1(t[i],", ") )
%Y A262254 Cf. A076653, A082238, A089755, A107809, A180022.
%K A262254 nonn,base
%O A262254 1,1
%A A262254 _Maghraoui Abdelkader_, Sep 16 2015