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!)
A217559 Terms as well as ending/starting digits have alternating primality; this is the lexicographically earliest injective sequence with this property. 4

%I #8 Jan 02 2023 12:30:49

%S 1,2,4,3,6,5,8,7,9,23,10,29,22,11,24,31,25,13,12,17,14,37,15,19,26,53,

%T 16,59,28,71,30,73,18,79,20,211,21,223,48,227,49,229,27,41,32,43,44,

%U 233,45,47,46,239,33,61,34,241,35,67,60,251,36,257,62,83,63,89,38,263,64,269,39,271,50,277

%N Terms as well as ending/starting digits have alternating primality; this is the lexicographically earliest injective sequence with this property.

%C Exactly every other term is prime; moreover the ending digit of a(n) and the initial digit of a(n+1) are never both prime or both composite.

%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2012-October/010253.html">Non-primes/primes: integers and digits alternate</a>, SeqFan mailing list, Oct 06 2012

%o (PARI) A217559(n,show_all=0,a=1,u)={for( i=2, n, u+=1<<a; show_all & print1(a","); for(t=1,9e9, bittest(u,t) & next; isprime(t)==bittest(i,0) & next; isprime(a%10) == isprime(t\10^(#Str(t)-1)) & (t+=10^(#Str(t)-1)-1) & next; a=t; break )); a}

%Y This is a simplified variant of A217560.

%Y See also A217555, A217556, where "primality" is replaced by "parity".

%K nonn,base

%O 1,2

%A _Eric Angelini_ and _M. F. Hasler_, Oct 06 2012

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 24 07:28 EDT 2024. Contains 371922 sequences. (Running on oeis4.)