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.

A181940 a(0)=0, and there are a(n) terms between a(n) and the nearest a(n)+1.

This page as a plain text file.
%I A181940 #10 May 30 2020 05:06:07
%S A181940 0,1,0,2,0,1,3,1,0,2,4,2,0,1,3,5,3,1,0,2,4,6,4,2,0,1,3,5,7,5,3,1,0,2,
%T A181940 4,6,8,6,4,2,0,1,3,5,7,9,7,5,3,1,0,2,4,6,8,10,8,6,4,2,0,1,3,5,7,9,11,
%U A181940 9,7,5,3,1,0,2,4,6,8,10,12,10,8,6,4,2,0,1,3,5,7,9,11,13,11,9,7,5,3,1,0,2,4,6,8,10,12
%N A181940 a(0)=0, and there are a(n) terms between a(n) and the nearest a(n)+1.
%F A181940 a(A000217(n))=n.
%e A181940 From _Peter Luschny_, May 30 2020: (Start)
%e A181940 Seen as a triangle:
%e A181940 [0]
%e A181940 [1, 0]
%e A181940 [2, 0, 1]
%e A181940 [3, 1, 0, 2]
%e A181940 [4, 2, 0, 1, 3]
%e A181940 [5, 3, 1, 0, 2, 4]
%e A181940 [6, 4, 2, 0, 1, 3, 5]
%e A181940 [7, 5, 3, 1, 0, 2, 4, 6]
%e A181940 [8, 6, 4, 2, 0, 1, 3, 5, 7]
%e A181940 [9, 7, 5, 3, 1, 0, 2, 4, 6, 8]
%e A181940 [10, 8, 6, 4, 2, 0, 1, 3, 5, 7, 9]
%e A181940 [11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10]
%e A181940 (End)
%o A181940 (PARI) a_list(N)={my(a=vector(2*N),c=0);for(i=2,N,a[i]=c++;my(j=i);for(k=1,c-1,a[j-=(-1)^k*(c-k+1)]=c-k);i+=c);vecextract(a,2^N-1)}
%o A181940 (Python)
%o A181940 def T(num_rows):
%o A181940     L, R = [0], [0]
%o A181940     for n in range(1, num_rows):
%o A181940         R.reverse()
%o A181940         R.insert(0, n)
%o A181940         L.extend(R)
%o A181940     return L
%o A181940 print(T(14)) # _Peter Luschny_, May 30 2020
%K A181940 nonn
%O A181940 0,4
%A A181940 _Eric Angelini_ and _M. F. Hasler_, Apr 03 2012