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.

A050140 a(n) = 2*floor(n*phi)-n, where phi = (1+sqrt(5))/2.

Original entry on oeis.org

1, 4, 5, 8, 11, 12, 15, 16, 19, 22, 23, 26, 29, 30, 33, 34, 37, 40, 41, 44, 45, 48, 51, 52, 55, 58, 59, 62, 63, 66, 69, 70, 73, 76, 77, 80, 81, 84, 87, 88, 91, 92, 95, 98, 99, 102, 105, 106, 109, 110, 113, 116, 117, 120, 121, 124, 127, 128, 131, 134, 135, 138, 139
Offset: 1

Views

Author

Keywords

Comments

Old name was a(n) = last number in repeating block in continued fraction for n*phi.

References

  • Alfred Brousseau, Fibonacci and Related Number Theoretic Tables, The Fibonacci Association, 1972, 101-103.

Crossrefs

Programs

  • Magma
    [-n + 2*Floor(n*(1+Sqrt(5))/2): n in [1..50]]; // G. C. Greubel, Oct 15 2017
    
  • Mathematica
    Table[-n+2Floor[n*GoldenRatio],{n,1,100}]
  • PARI
    for(n=1,50, print1(-n + 2*floor(n*(1+sqrt(5))/2), ", ")) \\ G. C. Greubel, Oct 15 2017
    
  • Python
    def A050140(n): return (n+isqrt(5*n**2)&-2)-n # Chai Wah Wu, Aug 25 2022

Formula

a(n) = -n + 2*floor(n*phi) = A283233(n)-n.
a(n) = floor(n*phi) + floor(n*sigma) where phi = (sqrt(5)+1)/2 and sigma = (sqrt(5)-1)/2.
a(n) = last number in repeating block in continued fraction for n*phi.

Extensions

Formula and more terms from Vladeta Jovovic, Nov 23 2001
Name changed by Michel Dekking, Dec 27 2017

A283234 2*A001950.

Original entry on oeis.org

4, 10, 14, 20, 26, 30, 36, 40, 46, 52, 56, 62, 68, 72, 78, 82, 88, 94, 98, 104, 108, 114, 120, 124, 130, 136, 140, 146, 150, 156, 162, 166, 172, 178, 182, 188, 192, 198, 204, 208, 214, 218, 224, 230, 234, 240, 246, 250, 256, 260, 266, 272, 276, 282, 286, 292
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2017

Keywords

Comments

This is one of three sequences that partition the positive integers. In general, suppose that r, s, t are positive real numbers for which the sets {i/r: i>=1}, {j/s: j>=1}, {k/t: k>=1} are pairwise disjoint. Let a(n) be the rank of n/r when all the numbers in the three sets are jointly ranked. Define b(n) and c(n) as the ranks of n/s and n/t. It is easy to prove that
a(n)=n+[ns/r]+[nt/r],
b(n)=n+[nr/s]+[nt/s],
c(n)=n+[nr/t]+[ns/t], where [ ]=floor.
Taking r=1, s=(-1+sqrt(5))/2, t=(1+sqrt(5))/2 gives

Crossrefs

Programs

  • Mathematica
    r = 1; s = (-1 + 5^(1/2))/2; t = (1 + 5^(1/2))/2;
    a[n_] := n + Floor[n*s/r] + Floor[n*t/r];
    b[n_] := n + Floor[n*r/s] + Floor[n*t/s];
    c[n_] := n + Floor[n*r/t] + Floor[n*s/t]
    Table[a[n], {n, 1, 120}]  (* A283233 *)
    Table[b[n], {n, 1, 120}]  (* A283234 *)
    Table[c[n], {n, 1, 120}]  (* A005408 *)
  • Python
    from math import isqrt
    def A283234(n): return ((n+isqrt(5*n**2))&-2)+(n<<1) # Chai Wah Wu, Aug 10 2022

Formula

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

A287802 Positions of 0 in A287801; complement of A287803.

Original entry on oeis.org

2, 3, 4, 5, 8, 9, 11, 12, 13, 14, 17, 18, 19, 20, 23, 24, 26, 27, 28, 29, 32, 33, 35, 36, 37, 38, 41, 42, 43, 44, 47, 48, 50, 51, 52, 53, 56, 57, 58, 59, 62, 63, 65, 66, 67, 68, 71, 72, 74, 75, 76, 77, 80, 81, 82, 83, 86, 87, 89, 90, 91, 92, 95, 96, 98, 99
Offset: 1

Views

Author

Clark Kimberling, Jun 03 2017

Keywords

Comments

Let d(n) = 3n/2 - a(n). Then d(n) is in {-1/2, 0, 1/2, 1} for n >= 1. Indeed,
d(n) = - 1/2 if n is in A075317; d(n) = 1/2 if n is in A075318;
d(n) = 0 if n is in A283234; d(n) = 1 if n is in A283233.

Crossrefs

Programs

  • Mathematica
    s = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 10] (* A003849 *)
    w = StringJoin[Map[ToString, s]]
    w1 = StringReplace[w, {"0" -> "100", "1" -> "001"}]
    st = ToCharacterCode[w1] - 48    (* A287801 *)
    Flatten[Position[st, 0]]  (* A287802 *)
    Flatten[Position[st, 1]]  (* A287803 *)
Showing 1-3 of 3 results.