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.

A094044 Alternate prime and nonprime numbers not included earlier such that every concatenation of a pair of terms is a prime: a(2n) is nonprime and a(2n-1) is prime.

This page as a plain text file.
%I A094044 #8 Oct 25 2017 05:13:07
%S A094044 2,9,7,1,3,49,19,33,13,21,11,51,47,87,31,63,17,77,23,39,29,27,41,57,
%T A094044 37,69,59,81,61,99,67,91,73,93,43,117,79,111,71,119,53,129,83,177,89,
%U A094044 123,113,143,107,171,103,141,97,159,157,133,109,121,139,169,151,153,137,147
%N A094044 Alternate prime and nonprime numbers not included earlier such that every concatenation of a pair of terms is a prime: a(2n) is nonprime and a(2n-1) is prime.
%C A094044 Conjecture: all members of A045572 are in the sequence. - _Robert Israel_, Oct 24 2017
%H A094044 Robert Israel, <a href="/A094044/b094044.txt">Table of n, a(n) for n = 1..10000</a>
%e A094044 a(3)=7 => 97 is a prime but not necessarily 297 (in fact not a prime).
%p A094044 N:= 1000: # to get terms before the first term > N
%p A094044 P, C:= selectremove(isprime, [1,$3..N]):
%p A094044 dcat:= proc(x,y) 10^(1+ilog10(y))*x+y end proc:
%p A094044 A[1]:= 2:
%p A094044 for n from 2 do
%p A094044   if n::even then
%p A094044     for j from 1 to nops(C) do
%p A094044       if isprime(dcat(A[n-1],C[j])) then
%p A094044          A[n]:= C[j];
%p A094044          C:= subsop(j=NULL,C);
%p A094044          break
%p A094044       fi
%p A094044     od
%p A094044   else
%p A094044     for j from 1 to nops(P) do
%p A094044       if isprime(dcat(A[n-1],P[j])) then
%p A094044         A[n]:= P[j];
%p A094044         P:= subsop(j=NULL,P);
%p A094044         break
%p A094044       fi
%p A094044     od
%p A094044   fi;
%p A094044   if not assigned(A[n]) then break fi
%p A094044 od:
%p A094044 seq(A[i],i=1..n-1); # _Robert Israel_, Oct 24 2017
%t A094044 p = Prime[ Range[ 500]]; np = Drop[ Complement[ Range[ 500], p], 1]; a[0] = 0; a[n_] := a[n] = Block[{k = 1, q = IntegerDigits[a[n - 1]]}, If[ OddQ[n], While[ !PrimeQ[ FromDigits[ Join[q, IntegerDigits[ p[[k]] ]]]], k++ ]; q = p[[k]]; p = Delete[p, k]; q, While[ !PrimeQ[ FromDigits[ Join[q, IntegerDigits[ np[[k]] ]]]], k++ ]; q = np[[k]]; np = Delete[np, k]; q]]; Table[ a[n], {n, 64}]
%Y A094044 Cf. A088614, A094045.
%K A094044 nonn,base
%O A094044 1,1
%A A094044 _Robert G. Wilson v_, Apr 23 2004