The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
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. 3
2, 9, 7, 1, 3, 49, 19, 33, 13, 21, 11, 51, 47, 87, 31, 63, 17, 77, 23, 39, 29, 27, 41, 57, 37, 69, 59, 81, 61, 99, 67, 91, 73, 93, 43, 117, 79, 111, 71, 119, 53, 129, 83, 177, 89, 123, 113, 143, 107, 171, 103, 141, 97, 159, 157, 133, 109, 121, 139, 169, 151, 153, 137, 147 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Conjecture: all members of A045572 are in the sequence. - Robert Israel, Oct 24 2017
LINKS
EXAMPLE
a(3)=7 => 97 is a prime but not necessarily 297 (in fact not a prime).
MAPLE
N:= 1000: # to get terms before the first term > N
P, C:= selectremove(isprime, [1, $3..N]):
dcat:= proc(x, y) 10^(1+ilog10(y))*x+y end proc:
A[1]:= 2:
for n from 2 do
if n::even then
for j from 1 to nops(C) do
if isprime(dcat(A[n-1], C[j])) then
A[n]:= C[j];
C:= subsop(j=NULL, C);
break
fi
od
else
for j from 1 to nops(P) do
if isprime(dcat(A[n-1], P[j])) then
A[n]:= P[j];
P:= subsop(j=NULL, P);
break
fi
od
fi;
if not assigned(A[n]) then break fi
od:
seq(A[i], i=1..n-1); # Robert Israel, Oct 24 2017
MATHEMATICA
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}]
CROSSREFS
Sequence in context: A016596 A201616 A197017 * A357109 A011070 A230480
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Apr 23 2004
STATUS
approved

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 May 15 22:47 EDT 2024. Contains 372549 sequences. (Running on oeis4.)