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.

Showing 1-3 of 3 results.

A293313 Greatest integer k such that k/2^n < (1+sqrt(5))/2 (the golden ratio).

Original entry on oeis.org

1, 3, 6, 12, 25, 51, 103, 207, 414, 828, 1656, 3313, 6627, 13254, 26509, 53019, 106039, 212078, 424157, 848315, 1696631, 3393263, 6786526, 13573052, 27146105, 54292211, 108584422, 217168845, 434337691, 868675383, 1737350766, 3474701532, 6949403065
Offset: 0

Views

Author

Clark Kimberling, Oct 06 2017

Keywords

Crossrefs

Programs

  • Maple
    A293313:=n->floor(2^n*(1+sqrt(5))/2): seq(A293313(n), n=0..40); # Wesley Ivan Hurt, Oct 06 2017
  • Mathematica
    z = 120; r = GoldenRatio;
    Table[Floor[r*2^n], {n, 0, z}];   (* A293313 *)
    Table[Ceiling[r*2^n], {n, 0, z}]; (* A293314 *)
    Table[Round[r*2^n], {n, 0, z}];   (* A293315 *)
  • PARI
    a(n) = (2^n*(1+sqrt(5)))\2; \\ Altug Alkan, Oct 06 2017

Formula

a(n) = floor(r*2^n), where r = (1+sqrt(5))/2.
a(n) = A293314(n) - 1.

A293315 The integer k that minimizes |k/2^n - r|, where r = golden ratio.

Original entry on oeis.org

2, 3, 6, 13, 26, 52, 104, 207, 414, 828, 1657, 3314, 6627, 13255, 26510, 53020, 106039, 212079, 424158, 848316, 1696632, 3393263, 6786526, 13573053, 27146106, 54292211, 108584423, 217168846, 434337692, 868675383, 1737350766, 3474701533, 6949403065
Offset: 0

Views

Author

Clark Kimberling, Oct 06 2017

Keywords

Crossrefs

Programs

  • Magma
    [Floor((2^n*(1+Sqrt(5))+1)/2): n in [0..33]]; // Vincenzo Librandi, Oct 08 2017
  • Maple
    A293315:=n->floor(1/2+2^n*(1+sqrt(5))/2): seq(A293315(n), n=0..40); # Wesley Ivan Hurt, Oct 06 2017
  • Mathematica
    z = 120; r = GoldenRatio;
    Table[Floor[r*2^n], {n, 0, z}];   (* A293313 *)
    Table[Ceiling[r*2^n], {n, 0, z}]; (* A293314 *)
    Table[Round[r*2^n], {n, 0, z}];   (* A293315 *)
  • PARI
    a(n) = (2^n*(1+sqrt(5))+1)\2; \\ Altug Alkan, Oct 06 2017
    

Formula

a(n) = floor(1/2 + r*2^n), where r = (1+sqrt(5))/2.
a(n) = A293313(n) if (fractional part of r*2^n) < 1/2, else a(n) = A293313(n).

A376448 a(n) = k if k is odd otherwise a(n) = k+1 and k = floor( 2^n*(1+sqrt(5))/2 ).

Original entry on oeis.org

1, 3, 7, 13, 25, 51, 103, 207, 415, 829, 1657, 3313, 6627, 13255, 26509, 53019, 106039, 212079, 424157, 848315, 1696631, 3393263, 6786527, 13573053, 27146105, 54292211, 108584423, 217168845, 434337691, 868675383, 1737350767, 3474701533, 6949403065, 13898806131, 27797612261, 55595224523
Offset: 0

Views

Author

Thomas Scheuerle, Sep 23 2024

Keywords

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.

Examples

			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).
		

Crossrefs

Programs

  • 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 *)
  • PARI
    a(n) = {my( m=floor(quadgen(5)<
    				

Formula

a(n) = 2*A293313(n-1) + 1, for n > 0.
Showing 1-3 of 3 results.