cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A353708 a(0)=0, a(1)=1; thereafter a(n) = smallest nonnegative integer not among the earlier terms of the sequence such that a(n) and a(n-2) have no common 1-bits in their binary representations.

This page as a plain text file.
%I A353708 #23 May 06 2022 19:48:27
%S A353708 0,1,2,4,5,3,8,12,6,16,9,7,18,24,13,32,34,10,17,20,14,11,33,36,22,19,
%T A353708 40,44,21,64,42,15,65,48,26,66,37,25,72,38,23,73,96,50,27,68,100,35,
%U A353708 128,28,29,67,98,52,129,74,30,49,97,70,130,41,45,80,82,39,132,88,43,131,84,56,136,69,51,58,76,133,144,90,46,160,81,31,134,192,57,47
%N A353708 a(0)=0, a(1)=1; thereafter a(n) = smallest nonnegative integer not among the earlier terms of the sequence such that a(n) and a(n-2) have no common 1-bits in their binary representations.
%C A353708 A set-theory analog of A121216.
%C A353708 This is a permutation of the nonnegative numbers.
%H A353708 Michael De Vlieger, <a href="/A353708/b353708.txt">Table of n, a(n) for n = 0..16384</a> (a(n) for n = 0..748 by N. J. A. Sloane)
%H A353708 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the nonnegative integers</a>
%p A353708 read(transforms) : # ANDnos def'd here
%p A353708 A353708 := proc(n)
%p A353708     option remember;
%p A353708     local c, i, known ;
%p A353708     if n <= 2 then
%p A353708         n;
%p A353708     else
%p A353708         for c from 1 do
%p A353708             known := false ;
%p A353708             for i from 1 to n-1 do
%p A353708                 if procname(i) = c then
%p A353708                     known := true;
%p A353708                     break ;
%p A353708                 end if;
%p A353708             end do:
%p A353708             if not known and ANDnos(c, procname(n-2)) =0 then
%p A353708                 return c;
%p A353708             end if;
%p A353708         end do:
%p A353708     end if;
%p A353708 end proc: # Following R. J. Mathar's program for A109812.
%p A353708 [seq(A353708(n), n=0..256)] ;
%p A353708 # second Maple program:
%p A353708 b:= proc() false end: t:= 2:
%p A353708 a:= proc(n) option remember; global t; local k; if n<2 then n
%p A353708       else for k from t while b(k) or Bits[And](k, a(n-2))>0
%p A353708       do od; b(k):=true; while b(t) do t:=t+1 od; k fi
%p A353708     end:
%p A353708 seq(a(n), n=0..100);  # _Alois P. Heinz_, May 06 2022
%t A353708 nn = 87; c[_] = -1; a[0] = c[0] = 0; a[1] = c[1] = 1; u = 2; Do[k = u; While[Nand[c[k] == -1, BitAnd[a[n - 2], k] == 0], k++]; Set[{a[n], c[k]}, {k, n}]; If[k == u, While[c[u] > -1, u++]], {n, 2, nn}]; Array[a, nn + 1, 0] (* _Michael De Vlieger_, May 06 2022 *)
%Y A353708 Cf. A109812, A121216.
%K A353708 nonn
%O A353708 0,3
%A A353708 _N. J. A. Sloane_, May 06 2022