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.

A256187 First differences of Per Nørgård's "infinity sequence" A004718.

This page as a plain text file.
%I A256187 #17 Mar 02 2023 20:09:36
%S A256187 1,-2,3,-1,-1,-2,5,-4,3,-2,1,1,-3,-2,7,-3,-1,-2,5,-3,1,-2,3,-4,5,-2,
%T A256187 -1,3,-5,-2,9,-6,3,-2,1,1,-3,-2,7,-4,1,-2,3,-1,-1,-2,5,-1,-3,-2,7,-5,
%U A256187 3,-2,1,-4,7,-2,-3,5,-7,-2,11,-5,-1,-2,5,-3,1,-2,3,-4
%N A256187 First differences of Per Nørgård's "infinity sequence" A004718.
%C A256187 Per Nørgård's surname is also written as Noergaard;
%C A256187 a(n) = A004718(n+1) - A004718(n);
%C A256187 a(n) != 0, as A004718 is non-repetitive;
%C A256187 for all integers k > 0, there exist infinitely many m such that abs(a(m)) = k, see link.
%H A256187 Reinhard Zumkeller, <a href="/A256187/b256187.txt">Table of n, a(n) for n = 0..10000</a>
%H A256187 Christopher Drexler-Lemire, Jeffrey Shallit, <a href="http://arxiv.org/abs/1402.3091">Notes and Note-Pairs in Noergaard's Infinity Series</a>, arXiv:1402.3091 [math.CO], 2014.
%t A256187 (* b = A004718 *) b[0] = 0; b[n_?EvenQ] := b[n] = -b[n/2]; b[n_] := b[n] = b[(n-1)/2] + 1;
%t A256187 Table[b[n], {n, 0, 72}] // Differences (* _Jean-François Alcover_, Dec 15 2018 *)
%o A256187 (Haskell)
%o A256187 a256187 n = a256187_list !! n
%o A256187 a256187_list = zipWith (-) (tail a004718_list) a004718_list
%o A256187 (Python)
%o A256187 from itertools import groupby
%o A256187 def A256187(n):
%o A256187     c, d = 0, 0
%o A256187     for k, g in groupby(bin(n+1)[2:]):
%o A256187         c = c+len(list(g)) if k == '1' else (-c if len(list(g))&1 else c)
%o A256187     for k, g in groupby(bin(n)[2:]):
%o A256187         d = d+len(list(g)) if k == '1' else (-d if len(list(g))&1 else d)
%o A256187     return c-d # _Chai Wah Wu_, Mar 02 2023
%Y A256187 Cf. A004718.
%K A256187 sign
%O A256187 0,2
%A A256187 _Reinhard Zumkeller_, Mar 19 2015