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.

A050136 a(n) = floor(a(n-1)/2) if this is not among 0,a(1),...,a(n-1), otherwise a(n)=5*n.

Original entry on oeis.org

1, 10, 5, 2, 25, 12, 6, 3, 45, 22, 11, 60, 30, 15, 7, 80, 40, 20, 95, 47, 23, 110, 55, 27, 13, 130, 65, 32, 16, 8, 4, 160, 165, 82, 41, 180, 90, 190, 195, 97, 48, 24, 215, 107, 53, 26, 235, 117, 58, 29, 14, 260, 265, 132, 66, 33, 285, 142, 71, 35, 17, 310, 155, 77, 38, 19, 9, 340, 170, 85, 42, 21
Offset: 1

Views

Author

Keywords

Comments

Does this sequence contain every positive integer exactly once?

Crossrefs

Programs

  • Maple
    S:= {0,1}: A[1]:= 1:
    for n from 2 to 100 do
      v:= floor(A[n-1]/2);
      if not member(v,S) then A[n]:= v
      else A[n]:= 5*n
      fi;
      S:= S union {A[n]};
    od:
    seq(A[i],i=1..100); # Robert Israel, Aug 07 2018
  • Mathematica
    f[s_List] := Block[{len = Length@s, m = Floor[s[[-1]]/2]}, Append[s, If[MemberQ[s, m], 5 len, m]]]; Rest@ Nest[f, {0, 1}, 65] (* Robert G. Wilson v, Aug 07 2018 *)

Extensions

Corrected by Robert Israel, Aug 07 2018