OFFSET
0,2
COMMENTS
The sequence of all multiples of an irrational b is equidistributed modulo 1. Such a sequence is called a Weyl sequence. It is common practice in computing to approximate a Weyl sequence by taking integer multiples of some integer m modulo a power of two. This requires that the integer m is odd. This sequence provides suitable m = a(n) for the case modulo 2^n. It utilizes the golden ratio for approximation of irrationality.
FORMULA
a(n) = 2*A293313(n-1) + 1, for n > 0.
EXAMPLE
An example for a pseudo Weyl sequence obtained from a(3):
{0, 1, 2, 3, 4, 5, 6, 7} * a(3) mod 2^3 = {0, 5, 2, 7, 4, 1, 6, 3}. (Without zero also part of A194868).
MATHEMATICA
k[n_]:=Floor[2^n*GoldenRatio]; Table[If[OddQ[k[n]], k[n], k[n]+1], {n, 0, 35}] (* James C. McMahon, Oct 20 2024 *)
PROG
(PARI) a(n) = {my( m=floor(quadgen(5)<<n) ); if(m%2==0, return(m+1), return(m))}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Thomas Scheuerle, Sep 23 2024
STATUS
approved