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.

A178333 Characteristic function of mountain numbers.

This page as a plain text file.
%I A178333 #15 Feb 22 2013 21:38:31
%S A178333 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
%T A178333 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
%U A178333 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
%N A178333 Characteristic function of mountain numbers.
%C A178333 a(A134941(n)) = 1; a(A134951(n)) = 1;
%C A178333 a(n) = 0 for n > 12345678987654321;
%C A178333 a(A011540(n))=0; a(A052383(n))=0; a(A171901(n))=0;
%C A178333 A178334(n) = SUM(a(k): 0<=k<=n).
%H A178333 R. Zumkeller, <a href="/A178333/b178333.txt">Table of n, a(n) for n = 0..20000</a>
%H A178333 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F A178333 a(n) = if n mod 10 = 1 then if n = 1 then 1 else g(n div 10, 1) else 0
%F A178333 with g(x, y) = if x mod 10 > y then g(x div 10, x mod 10) else if x mod 10 = y then 0 else h(x div 10, x mod 10)
%F A178333 and h(x, y) = if y = 1 then 0^x else if x mod 10 < y then h(x div 10, x mod 10) else 0.
%t A178333 a[n_] := Boole[ MatchQ[ IntegerDigits[n], {1, a___, b_, c___, 1} /; OrderedQ[{1, a, b}, Less] && OrderedQ[ {b, c, 1}, Greater]]]; a[1]=1; Table[a[n], {n, 0, 200}] (* _Jean-François Alcover_, Jun 13 2012 *)
%o A178333 (Haskell)
%o A178333 a178333 n = fromEnum $
%o A178333    n `mod` 10 == 1 && a000030 n == 1 && a196368 n == 1 && and down where
%o A178333       down = dropWhile (== False) $ zipWith (<) (tail $ show n) (show n)
%o A178333 a178333_list = map a178333 [0..]
%o A178333 -- _Reinhard Zumkeller_, Oct 28 2001
%Y A178333 Cf. A000030, A196368.
%K A178333 nonn,base
%O A178333 0,1
%A A178333 _Reinhard Zumkeller_, May 25 2010