login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #35 Nov 17 2015 21:07:57

%S 11,13,31,17,71,19,97,73,37,79,907,701,101,103,307,709,911,107,719,

%T 919,929,937,727,733,311,109,941,113,313,317,739,947,743,331,127,751,

%U 131,137,757,761,139,953,337,769,967,773,347,787,797,7001,149,971,151,157,7013,349,977,7019,983

%N 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 This sequence is different from A089755, as this one does not include single-digit primes.

%C 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 In this sequence, a(n+1) uses only the least-significant digit of a(n).

%H Maghraoui Abdelkader, <a href="/A262254/b262254.txt">Table of n, a(n) for n = 1..200</a>

%e a(3) = 31 where the most significant digit of 31 is 3, which is the least significant digit of a(2) = 13.

%t 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 (PARI) msd(n)=(n\10^(#Str(n)-1)); l1=1;l3=1;l7=1;l9=1; q=1; lsd(n)=n%10;

%o t1 = vector(200); i=1;forprime(n=11,10000, if( digits(n)[1]==1,t1[i]=n; i=i+1 ; )) ;

%o t3 = vector(130); i=1;forprime(n=31,3900 , if( digits(n)[1]==3,t3[i]=n; i=i+1 ; ));

%o t7 = vector(130); i=1;forprime(n=71,70000, if( digits(n)[1]==7,t7[i]=n; i=i+1 ; )) ;

%o 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 t = vector(200);

%o findnextnumber(m) =

%o {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 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 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 Cf. A076653, A082238, A089755, A107809, A180022.

%K nonn,base

%O 1,1

%A _Maghraoui Abdelkader_, Sep 16 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 11:08 EDT 2024. Contains 371711 sequences. (Running on oeis4.)