|
|
A319744
|
|
Partial sums of bouncy numbers (A152054).
|
|
1
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 101.
a(2) = 101 + 102 = 203.
a(10) = 101 + 102 + 103 + 104 + 105 + 106 + 107 + 108 + 109 + 120 = 1065.
|
|
PROG
|
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|