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.

A152054 Bouncy numbers (numbers whose digits are in neither increasing nor decreasing order).

This page as a plain text file.
%I A152054 #40 Jul 28 2023 10:40:34
%S A152054 101,102,103,104,105,106,107,108,109,120,121,130,131,132,140,141,142,
%T A152054 143,150,151,152,153,154,160,161,162,163,164,165,170,171,172,173,174,
%U A152054 175,176,180,181,182,183,184,185,186,187,190,191,192,193,194,195,196
%N A152054 Bouncy numbers (numbers whose digits are in neither increasing nor decreasing order).
%C A152054 Complement of union of A009994 and A009996. - _Ray Chandler_, Oct 25 2011
%C A152054 Number of n-digit bouncy numbers is 9*10^(n-1) - (n+18)*binomial(n+8, 8)/9 + 10. - _Altug Alkan_, Oct 02 2018
%H A152054 David F. Marrs, <a href="/A152054/b152054.txt">Table of n, a(n) for n = 1..10000</a>
%H A152054 Project Euler, <a href="http://projecteuler.net/problem=113">Non-bouncy numbers Problem 113</a>
%t A152054 Select[Range[0,200], !LessEqual@@IntegerDigits[#] && !GreaterEqual@@IntegerDigits[#]&] (* _Ray Chandler_, Oct 25 2011 *)
%t A152054 bnQ[n_]:=Module[{didn=Differences[IntegerDigits[n]]},Count[didn,_?(#>0&)]>0 && Count[didn,_?(#<0&)]>0]; Select[Range[100,200],bnQ] (* _Harvey P. Dale_, Jun 13 2020 *)
%o A152054 (Python)
%o A152054 a = 1
%o A152054 b = 100
%o A152054 while a != 51:
%o A152054     if str(b) != ''.join(sorted(str(b))) and str(b) != ''.join(sorted(str(b)))[::-1]:
%o A152054         print(b)
%o A152054         a += 1
%o A152054     b += 1
%o A152054 # _David F. Marrs_, Sep 25 2018
%o A152054 (Python)
%o A152054 from itertools import count, islice
%o A152054 def A152054_gen(startvalue=1): # generator of terms >= startvalue
%o A152054     for n in count(max(startvalue,1)):
%o A152054         l = len(s:=tuple(int(d) for d in str(n)))
%o A152054         for i in range(1,l-1):
%o A152054             if (s[i-1]-s[i])*(s[i]-s[i+1]) < 0:
%o A152054                 yield n
%o A152054                 break
%o A152054 A152054_list = list(islice(A152054_gen(),30)) # _Chai Wah Wu_, Jul 28 2023
%Y A152054 Cf. A152464. - _Jon E. Schoenfield_, Dec 06 2008
%Y A152054 Cf. A009994, A009996, A204692.
%K A152054 nonn,base,easy
%O A152054 1,1
%A A152054 Jerome Abela (Jerome.Abela(AT)gmail.com), Nov 22 2008
%E A152054 More terms from _Jon E. Schoenfield_, Dec 06 2008