OFFSET
1,2
COMMENTS
Consider the (0,1)-triangle T_0(P) with entries numbered 1,2,3,4,..., the rows of which, read in binary and converted to decimal, give the sequence 0 followed by consecutive primes, 0,2,3,5,7,...
Let the operator A_k map every k-th entry to its binary opposite (1->0, 0->1), for k=1,2,... .
Put T_inf(P) = ...*A_3*A_2*A_1(T_(0)P), with successive applications of the operators A_1, A_2, A_3, ...
Note that the (0,1)-triangle T_inf(P) is well-defined, since the operator T_n does not affect entries in the first floor((sqrt(8*n-7) - 1)/2) rows.
The sequence lists numbers obtained by reading rows of T_inf(P) in binary and converting them to decimal.
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 1..500
FORMULA
If we take the initial triangle T_0(O) to consist of all 0's, then in T_inf(O) the 1's are only on positions of squares of all positive numbers, i.e., 1,4,9,16,... . Indeed, in order to get an entry in the n-th position of T_inf(O), we should use all considered operators A_d, d|n. The number of these operators is the number of divisors of n which is odd iff n is a perfect square. Thus only in this case, we obtain that entry in the n-th position is flipped, beginning with 0, an odd number of times, such that in the n-th position of T_inf(O) we have 1, while, if n is nonsquare, in the n-th position we have 0.
T_inf(O) begins:
1
00
100
0010
00000
100000
0001000
00000001
.........
Now we have T_inf(P) = XNOR(T_0(P), T_inf(O)).
EXAMPLE
T_0(P) begins:
0
10
11
101
111
1011
1101
10001
........
T_inf(P) begins:
1
10
111
0111
00111
101011
0000101
00010000
000010011
0001010111
00000011001
000000011111
0010000100101
.............
MATHEMATICA
seq=Apply[BitXor, {Map[If[IntegerQ[Sqrt[#]], 1, 0]&, Range[Length[#]]], #}&[Flatten[Join[{{0}}, Map[IntegerDigits[Prime[#], 2, #+1]&, Range[50]]]]]];
Map[FromDigits[#, 2]&, MapThread[seq[[#1;; #2]]&, ({Join[{0}, Most[#1]]+1, #1}&)[#/2(#+1)&[Range[NestWhile[#+1&, 1, ((1+#1) (2+#1)<=2Length[seq])&]]]]]] (* Peter J. C. Moses, Nov 18 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev and Peter J. C. Moses, Nov 16 2014
STATUS
approved
