How to resolve the algorithm Hickerson series of almost integers step by step in the zkl programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Hickerson series of almost integers step by step in the zkl programming language

Table of Contents

Problem Statement

The following function,   due to D. Hickerson,   is said to generate "Almost integers" by the "Almost Integer" page of Wolfram MathWorld,   (December 31 2013).   (See formula numbered   51.)

The function is:

h ( n )

n !

2 ( ln ⁡

2

)

n + 1

{\displaystyle h(n)={\operatorname {n} ! \over 2(\ln {2})^{n+1}}}

It is said to produce "almost integers" for   n   between   1   and   17.
The purpose of the task is to verify this assertion. Assume that an "almost integer" has either a nine or a zero as its first digit after the decimal point of its decimal string representation

Calculate all values of the function checking and stating which are "almost integers". Note: Use extended/arbitrary precision numbers in your calculation if necessary to ensure you have adequate precision of results as for example:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Hickerson series of almost integers step by step in the zkl programming language

Source code in the zkl programming language

var [const] BN=Import("zklBigNum"),
   X   =BN("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
   ln2X=BN("693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687")
   ;
fcn hickerson(n){ BN(n).factorial()*X.pow(n+1)*10/2/ln2X.pow(n+1) }

foreach n in ([1..18]){
   hs,ld,isH:=hickerson(n).toString(),hs[-1],"90".holds(ld);
   println("h(%2d)=%s.%s almost integer: %b".fmt(n,hs[0,-1],ld,isH));
}

  

You may also check:How to resolve the algorithm Van der Corput sequence step by step in the EDSAC order code programming language
You may also check:How to resolve the algorithm CRC-32 step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm The sieve of Sundaram step by step in the Phix programming language
You may also check:How to resolve the algorithm Set step by step in the Phixmonti programming language
You may also check:How to resolve the algorithm User input/Graphical step by step in the C programming language