login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1; for n > 1, a(n) is the smallest unused positive number such that (a(n-1) AND a(n)) = a(n-1) if a(n-1) is prime, otherwise (a(n-1) AND a(n)) = 0, where AND is the binary AND operation.
2

%I #17 Oct 03 2024 07:38:18

%S 1,2,3,7,15,16,4,8,5,13,29,31,63,64,6,9,18,12,17,19,23,55,72,20,10,21,

%T 32,11,27,36,24,33,14,48,65,22,40,66,25,34,28,35,68,26,37,39,80,38,73,

%U 75,52,67,71,79,95,128,30,96,129,42,69,50,76,49,70,41,43,47,111,144,44,81,46,145,74,53,61,125,130,45,82,132,51,136,54,137,139,143,112

%N a(1) = 1; for n > 1, a(n) is the smallest unused positive number such that (a(n-1) AND a(n)) = a(n-1) if a(n-1) is prime, otherwise (a(n-1) AND a(n)) = 0, where AND is the binary AND operation.

%C The terms form a pattern similar to that in A109812. In the first 250000 terms the fixed points are 1, 2, 3, 8, 3650, 50624, 203074. The sequence is conjectured to be a permutation of the positive integers.

%H Scott R. Shannon, <a href="/A375828/b375828.txt">Table of n, a(n) for n = 1..10000</a>

%H Scott R. Shannon, <a href="/A375828/a375828.png">Image of the first 250000 terms</a>. The green line is a(n) = n.

%e a(5) = 15 as a(4) = 7 = 111_2 is prime, and ((15 = 1111_2) AND 111_2) = 111_2 = 7.

%e a(6) = 16 as a(5) = 15 = 1111_2 is not prime, and ((16 = 10000_2) AND 1111_2) = 0.

%Y Cf. A375829, A109812, A007088, A115510, A000040, A353989.

%K nonn

%O 1,2

%A _Scott R. Shannon_, Aug 30 2024