How to resolve the algorithm Fusc sequence step by step in the BQN programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Fusc sequence step by step in the BQN programming language
Table of Contents
Problem Statement
The fusc integer sequence is defined as:
Note that MathWorld's definition starts with unity, not zero. This task will be using the OEIS' version (above).
where A is some non-negative integer expressed in binary, and where B is the binary value of A reversed.
Fusc numbers are also known as:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Fusc sequence step by step in the BQN programming language
Source code in the bqn programming language
Fusc ← {
{
𝕩∾+´(⍷(⌈∾⌊)2÷˜≠𝕩)⊑¨<𝕩
}⍟(𝕩-2)↕2
}
•Show Fusc 61
•Show >⟨"Index"‿"Number"⟩∾{((1+↕4)⊐˜(⌊1+10⋆⁼1⌈|)¨𝕩){𝕨∾𝕨⊑𝕩}¨<𝕩} Fusc 99999
⟨ 0 1 1 2 1 3 2 3 1 4 3 5 2 5 3 4 1 5 4 7 3 8 5 7 2 7 5 8 3 7 4 5 1 6 5 9 4 11 7 10 3 11 8 13 5 12 7 9 2 9 7 12 5 13 8 11 3 10 7 11 4 ⟩
┌─
╵ "Index" "Number"
0 0
37 11
1173 108
35499 1076
┘
You may also check:How to resolve the algorithm Singly-linked list/Element definition step by step in the Modula-2 programming language
You may also check:How to resolve the algorithm Arithmetic/Integer step by step in the NetRexx programming language
You may also check:How to resolve the algorithm Kronecker product step by step in the Go programming language
You may also check:How to resolve the algorithm Formatted numeric output step by step in the Mathematica / Wolfram Language programming language
You may also check:How to resolve the algorithm Multisplit step by step in the Scala programming language