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-2 of 2 results.

A033989 Write 0,1,2,... in a clockwise spiral on a square lattice, writing each digit at a separate lattice point, starting with 0 at the origin and 1 at x=0, y=-1; sequence gives the numbers on the negative x-axis.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			  2---3---2---4---2---5---2
  |                       |
  2   1---3---1---4---1   6
  |   |               |   |
  2   2   4---5---6   5   2
  |   |   |       |   |   |
  1   1   3   0   7   1   7
  |   |   |   |   |   |   |
  2   1   2---1   8   6   2
  |   |           |   |   |
  0   1---0---1---9   1   8
  |                   |   |
  2---9---1---8---1---7   2
We begin with the 0 and wrap the numbers 1 2 3 4 ... around it. Then the sequence is obtained by reading leftwards, starting from the initial 0. - _Andrew Woods_, May 20 2012
		

Crossrefs

Sequences based on the same spiral: A033953, A033988, A033990. Spiral without zero: A033952.
Other sequences from spirals: A001107, A002939, A007742, A033951, A033954, A033991, A002943, A033996, A033988.

Programs

Formula

a(n) = A033307(4*n^2-n-1) for n > 0. - Andrew Woods, May 20 2012

Extensions

More terms from Andrew J. Gacek (andrew(AT)dgi.net)
Edited by Charles R Greathouse IV, Nov 01 2009

A156140 Accumulation of Stern's diatomic series: a(0)=-1, a(1)=0, and a(n+1) = (2e(n)+1)*a(n) - a(n-1) for n > 1, where e(n) is the highest power of 2 dividing n.

Original entry on oeis.org

-1, 0, 1, 3, 2, 7, 5, 8, 3, 13, 10, 17, 7, 18, 11, 15, 4, 21, 17, 30, 13, 35, 22, 31, 9, 32, 23, 37, 14, 33, 19, 24, 5, 31, 26, 47, 21, 58, 37, 53, 16, 59, 43, 70, 27, 65, 38, 49, 11, 50, 39, 67, 28, 73, 45, 62, 17, 57, 40, 63, 23, 52, 29, 35, 6, 43, 37, 68, 31, 87, 56, 81, 25, 94, 69
Offset: 0

Views

Author

Arie Werksma (Werksma(AT)Tiscali.nl), Feb 04 2009

Keywords

Crossrefs

From Yosu Yurramendi, Mar 09 2018: (Start)
a(2^m + 0) = A000027(m), m >= 0.
a(2^m + 1) = A002061(m+2), m >= 1.
a(2^m + 2) = A002522(m), m >= 2.
a(2^m + 3) = A033816(m-1), m >= 2.
a(2^m + 4) = A002061(m), m >= 2.
a(2^m + 5) = A141631(m), m >= 3.
a(2^m + 6) = A084849(m-1), m >= 3.
a(2^m + 7) = A056108(m-1), m >= 3.
a(2^m + 8) = A000290(m-1), m >= 3.
a(2^m + 9) = A185950(m-1), m >= 4.
a(2^m + 10) = A144390(m-1), m >= 4.
a(2^m + 12) = A014106(m-2), m >= 4.
a(2^m + 16) = A028387(m-3), m >= 4.
a(2^m + 18) = A250657(m-4), m >= 5.
a(2^m + 20) = A140677(m-3), m >= 5.
a(2^m + 32) = A028872(m-2), m >= 5.
a(2^m - 1) = A005563(m-1), m >= 0.
a(2^m - 2) = A028387(m-2), m >= 2.
a(2^m - 3) = A033537(m-2), m >= 2.
a(2^m - 4) = A008865(m-1), m >= 3.
a(2^m - 7) = A140678(m-3), m >= 3.
a(2^m - 8) = A014209(m-3), m >= 4.
a(2^m - 16) = A028875(m-2), m >= 5.
a(2^m - 32) = A108195(m-5), m >= 6.
(End)

Programs

  • Maple
    A156140 := proc(n)
        option remember ;
        if n <= 1 then
            n-1 ;
        else
            (2*A007814(n-1)+1)*procname(n-1)-procname(n-2) ;
        end if;
    end proc:
    seq(A156140(n),n=0..80) ; # R. J. Mathar, Mar 14 2009
  • Mathematica
    Fold[Append[#1, (2 IntegerExponent[#2, 2] + 1) #1[[-1]] - #1[[-2]] ] &, {-1, 0}, Range[73]] (* Michael De Vlieger, Mar 09 2018 *)
  • PARI
    first(n)=my(v=vector(n+1)); v[1]=-1; v[2]=0; for(k=1,n-1,v[k+2]=(2*valuation(k,2)+1)*v[k+1] - v[k]); v \\ Charles R Greathouse IV, Apr 05 2016
    
  • PARI
    fusc(n)=my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); b
    a(n)=my(m=1,s,t); if(n==0, return(-1)); while(n%2==0, s+=fusc(n>>=1)); while(n>1, t=logint(n,2); n-=2^t; s+=m*fusc(n)*(t^2+t+1); m*=-t); m*(n-1) + s \\ Charles R Greathouse IV, Dec 13 2016
    
  • R
    a <- c(0,1)
    maxlevel <- 6 # by choice
    for(m in 1:maxlevel) {
      a[2^(m+1)] <- m + 1
      for(k in 1:(2^m-1)) {
        r <- m - floor(log2(k)) - 1
        a[2^r*(2*k+1)] <- a[2^r*(2*k)] + a[2^r*(2*k+2)]
    }}
    a
    # Yosu Yurramendi, May 08 2018

Formula

Let b(n) = A002487(n), Stern's diatomic series.
a(n+1)*b(n) - a(n)*b(n+1) = 1 for n >= 0.
a(2n+1) = a(n) + a(n+1) + b(n) + b(n+1) for n >= 0.
a(2n) = a(n) + b(n) for n >= 0.
a(2^n + k) = -n*a(k) + (n^2 + n + 1)*b(k) for 0 <= k <= 2^n.
b(2^n + k) = -a(k) + (n + 1)*b(k) for 0 <= k <= 2^n.
a(2^m + k) = b(2^m+k)*m + b(k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Mar 09 2018
a(2^(m+1)+2^m+1) = 2*m+1, m >= 0. - Yosu Yurramendi, Mar 09 2018
From Yosu Yurramendi, May 08 2018: (Start)
a(2^m) = m, m >= 0.
a(2^r*(2*k+1)) = a(2^r*(2*k)) + a(2^r*(2*k+2)), r = m - floor(log_2(k)) - 1, m > 0, 1 <= k < 2^m.
(End)
Showing 1-2 of 2 results.