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.

A257971 First differences of A006921.

Original entry on oeis.org

0, 2, -1, 5, -2, 8, -5, 21, -8, 34, -21, 81, -34, 128, -81, 337, -128, 546, -337, 1301, -546, 2056, -1301, 5381, -2056, 8706, -5381, 20737, -8706, 32768, -20737, 86273, -32768, 139778, -86273, 333061, -139778, 526344, -333061, 1377557, -526344, 2228770
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 14 2015

Keywords

Crossrefs

Programs

  • Haskell
    a257971 n = a257971_list !! n
    a257971_list = zipWith (-) (tail a006921_list) a006921_list
    
  • Python
    def A257971(n): return sum(int(not r & ~(n+2-r))*2**(n//2+1-r) for r in range(n//2+2)) if n & 1 else -sum(int(not r & ~(n-1-r))*2**(n//2-1-r) for r in range(n//2)) # Chai Wah Wu, Jun 20 2022

Formula

a(2*n) = - A168081(n), a(2*n+1) = A168081(n+2);
a(2*n+4) = - a(2*n+1).