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.

A020947 Least k such that A(k) = n, where A( ) is sequence A020943.

Original entry on oeis.org

2, 6, 15, 14, 28, 61, 30, 58, 121, 60, 62, 116, 241, 120, 245, 122, 124, 469, 234, 806, 509, 254, 242, 248, 244, 252, 250, 466, 510, 468, 494, 482, 486, 977, 488, 484, 504, 492, 930, 490, 506, 936, 500, 932, 940, 966
Offset: 1

Views

Author

Keywords

Crossrefs

A020943 a(2n+1) = |a(2n) - a(2n-1)|, a(2n) = a(n) + a(n-1).

Original entry on oeis.org

0, 1, 1, 1, 0, 2, 2, 2, 0, 1, 1, 2, 1, 4, 3, 4, 1, 2, 1, 1, 0, 2, 2, 3, 1, 3, 2, 5, 3, 7, 4, 7, 3, 5, 2, 3, 1, 3, 2, 2, 0, 1, 1, 2, 1, 4, 3, 5, 2, 4, 2, 4, 2, 5, 3, 7, 4, 8, 4, 10, 6, 11, 5, 11, 6, 10, 4, 8, 4, 7, 3, 5, 2, 4, 2, 4, 2, 5, 3, 4, 1, 2, 1, 1, 0, 2, 2, 3, 1, 3, 2, 5, 3, 7, 4, 8, 4, 7, 3, 6, 3, 6, 3
Offset: 1

Views

Author

Keywords

Comments

Presumably, the positions n such that a(n)=0 are the terms of A097074. - Ivan Neretin, Jul 06 2015

Crossrefs

Programs

  • Mathematica
    a = {0, 1, 1}; Do[AppendTo[a, a[[n]] + a[[n - 1]]]; AppendTo[a, Abs[a[[-1]] - a[[-2]]]], {n, 2, 51}]; a (* Ivan Neretin, Jul 06 2015 *)

Extensions

More terms from Henry Bottomley, May 16 2001

A020944 a(2n+1) = |a(2n) - a(2n-1)|, a(2n) = a(n) + a(n-1), a(0) = -1.

Original entry on oeis.org

-1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3
Offset: 0

Views

Author

Keywords

Comments

a(n) = abs(t(n+1)) if n>0 where t(n) is the twisted Stern sequence defined by R. Bacher and M. Coons. - Michael Somos, Jan 08 2011
a(A153893(n)) = 0. - Reinhard Zumkeller, Mar 13 2011

Examples

			G.f. = -1 + x + x^3 + x^4 + x^6 + x^7 + 2*x^8 + x^9 + x^10 + x^12 + x^13 + 2*x^14 + ...
		

Crossrefs

Programs

  • Haskell
    a020944 n = a020944_list !! n
    a020944_list = -1 : f [1,0] where f (x:y:xs) = x : f (y:xs ++ [x,x+y])
    -- Same list generator function as for a020951_list, cf. A020951.
    -- Reinhard Zumkeller, Mar 13 2013
  • Mathematica
    a[ n_] := Which[ n < 2, Boole[n == 1] - Boole[n == 0], OddQ[n], Abs[a[n - 1] - a[n - 2]], True, a[n/2] + a[n/2 - 1]]; (* Michael Somos, Jul 25 2018 *)
  • PARI
    {a(n) = if( n<2,(n==1) - (n==0),  n%2, abs( a(n-1) - a(n-2) ), a(n/2) + a(n/2 - 1) )}; /* Michael Somos, Jan 08 2011 */
    
  • PARI
    {a(n) = my(A, m); if( n<0, 0, m = 1; A = -1 + O(x); while( m <= n, m*=2; A = 2*x + (1 + x + x^2) * subst( A, x, x^2 ) ); polcoeff( A, n ) )}; /* Michael Somos, Jan 08 2011 */
    

Formula

G.f. A(x) satisfies: A(x) = 2*x + (1 + x + x^2) * A(x^2). - Michael Somos, Jan 08 2011

Extensions

More terms from Henry Bottomley, May 16 2001
Added a(0) from Michael Somos, Jan 08 2011
Showing 1-3 of 3 results.