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.

A037849 a(n) = Sum_{d(i) < d(i-1), i=1..m} (d(i-1) - d(i)), where Sum{d(i)*8^i: i=0,1,...,m} is the base-8 representation of n.

This page as a plain text file.
%I A037849 #19 Jan 28 2019 02:09:08
%S A037849 0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,0,0,0,1,2,3,4,5,0,0,0,0,1,2,3,4,0,0,0,
%T A037849 0,0,1,2,3,0,0,0,0,0,0,1,2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,2,3,4,
%U A037849 5,6,7,0,0,1,2,3,4,5,6,1,1,1,2,3,4,5,6,2,2,2
%N A037849 a(n) = Sum_{d(i) < d(i-1), i=1..m} (d(i-1) - d(i)), where Sum{d(i)*8^i: i=0,1,...,m} is the base-8 representation of n.
%C A037849 This is the base-8 up-variation sequence; see A297330. - _Clark Kimberling_, Jan 18 2017
%H A037849 Clark Kimberling, <a href="/A037849/b037849.txt">Table of n, a(n) for n = 1..10000</a>
%p A037849 A037849 := proc(n)
%p A037849     a := 0 ;
%p A037849     dgs := convert(n,base,8);
%p A037849     for i from 2 to nops(dgs) do
%p A037849         if op(i,dgs)<op(i-1,dgs) then
%p A037849             a := a-op(i,dgs)+op(i-1,dgs) ;
%p A037849         end if;
%p A037849     end do:
%p A037849     a ;
%p A037849 end proc: # _R. J. Mathar_, Oct 19 2015
%t A037849 g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 8; z = 120;
%t A037849 Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}];  (* A037858 *)
%t A037849 Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}];   (* A037849 *)
%Y A037849 Cf. A007094, A037858, A297330.
%K A037849 nonn,base
%O A037849 1,11
%A A037849 _Clark Kimberling_
%E A037849 Definition swapped with A037858 by _R. J. Mathar_, Oct 19 2015
%E A037849 Updated by _Clark Kimberling_, Jan 19 2018