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.

A169747 a(1)=1; thereafter, a(2n)=a(n), a(2n+1) = a(2n-1)-a(n) if that number is positive and not already in the sequence, otherwise a(2n+1) = a(2n-1)+a(n).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 9, 5, 14, 1, 13, 4, 17, 3, 20, 7, 27, 2, 25, 9, 16, 5, 11, 14, 25, 1, 24, 13, 37, 4, 33, 17, 50, 3, 47, 20, 67, 7, 60, 27, 87, 2, 85, 25, 110, 9, 101, 16, 117, 5, 112, 11, 123, 14, 109, 25, 84, 1, 83, 24, 59, 13, 46, 37, 83, 4, 79, 33, 112, 17, 95
Offset: 1

Views

Author

N. J. A. Sloane, May 02 2010

Keywords

Comments

Suggested by A005132, A030067, A109671.

Programs

  • Mathematica
    a={1,1};Do[c=If[EvenQ[n],a[[n/2]],If[(b=a[[n-2]]-a[[(n-1)/2]])>0&&FreeQ[a,b],b,a[[n-2]]+a[[(n-1)/2]]]];AppendTo[a,c],{n,3,1000}];a (* Zak Seidov, May 04 2010 *)

Extensions

More terms from Zak Seidov, May 04 2010