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.

A319744 Partial sums of bouncy numbers (A152054).

Original entry on oeis.org

101, 203, 306, 410, 515, 621, 728, 836, 945, 1065, 1186, 1316, 1447, 1579, 1719, 1860, 2002, 2145, 2295, 2446, 2598, 2751, 2905, 3065, 3226, 3388, 3551, 3715, 3880, 4050, 4221, 4393, 4566, 4740, 4915, 5091, 5271, 5452, 5634, 5817, 6001, 6186, 6372, 6559, 6749, 6940, 7132, 7325, 7519
Offset: 1

Views

Author

David F. Marrs, Oct 21 2018

Keywords

Examples

			a(1) = 101.
a(2) = 101 + 102 = 203.
a(10) = 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 120 = 1065.
		

Crossrefs

Cf. A152054 (bouncy numbers).

Programs

  • Python
    for n in range(50):
      a = n
      b = 0
      c = 0
      while a:
        if ''.join(sorted(str(b))) != str(b) and ''.join(sorted(str(b)))[::-1] != str(b): c += b; a -= 1
        b += 1
      print(c)
    
  • Python
    from itertools import count, islice
    def A319744_gen(): # generator of terms
        c = 0
        for n in count(101):
            l = len(s:=tuple(int(d) for d in str(n)))
            for i in range(1,l-1):
                if (s[i-1]-s[i])*(s[i]-s[i+1]) < 0:
                    c += n
                    yield c
                    break
    A319744_list = list(islice(A319744_gen(),30)) # Chai Wah Wu, Jul 28 2023