src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Observable<R> scanWith(Callable<R> seedSupplier, BiFunction<R, ? super T, R> accumulator) {
        ObjectHelper.requireNonNull(seedSupplier, "seedSupplier is null");
        ObjectHelper.requireNonNull(accumulator, "accumulator is null");
        return RxJavaPlugins.onAssembly(new ObservableScanSeed<T, R>(this, seedSupplier, accumulator));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Observable<R> scanWith(Callable<R> seedSupplier, BiFunction<R, ? super T, R> accumulator) {
        ObjectHelper.requireNonNull(seedSupplier, "seedSupplier is null");
        ObjectHelper.requireNonNull(accumulator, "accumulator is null");
        return RxJavaPlugins.onAssembly(new ObservableScanSeed<T, R>(this, seedSupplier, accumulator));
    }
Returns an Observable that applies a specified accumulator function to the first item emitted by a source
ObservableSource and a seed value, then feeds the result of that function along with the second item emitted by
the source ObservableSource into the same function, and so on until all items have been emitted by the source
ObservableSource, emitting the result of each of these iterations.
<p>
<img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.png" alt="">
<p>
This sort of function is sometimes called an accumulator.
<p>
Note that the ObservableSource that results from this method will emit the value returned
by the {@code seedSupplier} as its first item.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code scanWith} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <R> the initial, accumulator and result type
@param seedSupplier
a Callable that returns the initial (seed) accumulator item for each individual Observer
@param accumulator
an accumulator function to be invoked on each item emitted by the source ObservableSource, whose
result will be emitted to {@link Observer}s via {@link Observer#onNext onNext} and used in the
next accumulator call
@return an Observable that emits {@code initialValue} followed by the results of each call to the
accumulator function
@see <a href="http://reactivex.io/documentation/operators/scan.html">ReactiveX operators documentation: Scan</a>