OFFSET

1,1

COMMENTS

As described in A051006, a monotonic sequence can be mapped into a fractional real. Then the binary digits of that real can be treated (transformed) by an elementary cellular automaton. Taken resulted sequence of binary digits as a fractional real, it can be mapped back into a sequence, as in A092855.

n is in this sequence if either n-2 OR n is prime but not both. Similar simple propositional rules can be given for all "RuleXXX" transforms of primes (or any strictly monotone sequence with a well-defined characteristic function) because the idea in these sequences is to take the characteristic function, consider it as an infinite binary word, apply one generation of some one-dimensional cellular automaton rule "XXX" to it and define the new sequence by this characteristic function. - Antti Karttunen, Apr 22 2004

For example, 2 is included because 0 is not prime, but 2 is. 3 is included because 1 is not prime, but 3 is. 4 is included because 2 is prime, although 4 is not. 5 is not included because both 3 and 5 are primes, 9 is included because 7 is prime, but 9 is not.

LINKS

Eric Weisstein's World of Mathematics, Elementary Cellular Automaton

PROG

(PARI) {ca_tr(ca, v)= /* Calculates the Cellular Automaton transform of the vector v by the rule ca */

local(cav=vector(8), a, r=[], i, j, k, l, po, p=vector(3));

a=binary(min(255, ca)); k=matsize(a)[2]; forstep(i=k, 1, - 1, cav[k-i+1]=a[i]);

j=0; l=matsize(v)[2]; k=v[l]; po=1;

for(i=1, k+2, j*=2; po=isin(i, v, l, po); j=(j+max(0, sign(po)))% 8; if(cav[j+1], r=concat(r, i)));

return(r) /* See the function "isin" at A092875 */}

CROSSREFS

KEYWORD

easy,nonn

AUTHOR

Ferenc Adorjan (fadorjan(AT)freemail.hu)

STATUS

approved