|
|
A309059
|
|
a(1) = 1; for n > 1, a(n) = 2 if the concatenation of all the previous terms is prime and a(n) = 1 otherwise.
|
|
2
|
|
|
1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Does this sequence contain an infinite number of 2s?
|
|
LINKS
|
|
|
EXAMPLE
|
For n = 2, the concatenation of the previous terms is 1, which is not prime, so a(2) = 1.
For n = 3, the concatenation of the previous terms is 11, which is prime, so a(3) = 2.
For n = 4, the concatenation of the previous terms is 112 = 2^4 * 7, which is clearly not prime, so a(4) = 1.
|
|
MAPLE
|
A[1]:= 1; x:= 1;
for i from 2 to 100 do
if isprime(x) then A[i]:= 2; x:= 10*x+2;
else A[i]:= 1; x:= 10*x+1
fi
od:
|
|
MATHEMATICA
|
IntegerDigits[NestList[10# + If[PrimeQ[#], 2, 1] &, 1, 80][[-1]]] (* Alonso del Arte, Jul 13 2019 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|