login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

First differences of A043555 = number of runs in base-3 representation of n.
1

%I #6 Jul 15 2024 23:38:04

%S 0,0,1,-1,1,0,0,-1,1,1,0,-1,-1,1,1,0,-1,0,1,0,0,-1,1,-1,0,-1,1,1,0,1,

%T -1,1,0,0,-1,-1,1,0,-1,-1,1,1,0,-1,1,1,0,0,-1,1,-1,0,-1,0,1,0,1,-1,1,

%U 0,0,-1,0,1,0,-1,-1,1,1,0,-1,-1,1,0,0,-1,1,-1,0,-1,1,1,0,1,-1,1,0,0,-1,1,1,0,-1,-1,1,1,0,-1,0,1

%N First differences of A043555 = number of runs in base-3 representation of n.

%H Brad Klee, <a href="https://community.wolfram.com/groups/-/m/t/3208738">A new space-filling dragon curve theorem</a>, on community.wolfram.com/groups, Jul 10, 2024

%p b:= n-> `if`(n<3, 1, b(iquo(n, 3))+`if`(n mod 9 in {0, 4, 8}, 0, 1)):

%p a:= n-> b(n+1)-b(n):

%p seq(a(n), n=0..99); # _Alois P. Heinz_, Jul 14 2024

%o (PARI) A373470(n)=A043555(n+1)-A043555(n) /* with {A043555(n)=my(d=digits(n, 3)); sum(i=2, #d, d[i]!=d[i-1])+1} */

%Y Cf. A043555, A297770.

%K sign,base,less

%O 0

%A _M. F. Hasler_, Jul 13 2024