Original entry on oeis.org
0, 1, -1, -4, -9, -17, -23, -34, -47, -68, -84, -75, -117, -141, -166, -193, -227, -262, -308, -298, -296, -206, -164, -133, -107, -96, -66, -48, 10, 51, 71, 157, 200, 260, 305, 408, 456, 510, 615, 698, 650, 499, 344, 285, 198, 119, -27, 79, -78, -187, -405
Offset: 1
a(3) = A377388(1) + A377388(2) + A377388(3) = 0 + 1 - 2 = -1.
A377351
Lexicographically earliest sequence of positive integers such that the means of consecutive terms are all distinct.
Original entry on oeis.org
1, 2, 4, 7, 5, 10, 12, 18, 13, 16, 28, 23, 14, 25, 48, 32, 17, 46, 30, 45, 67, 60, 27, 71, 39, 85, 68, 99, 78, 44, 102, 87, 126, 57, 118, 69, 121, 74, 125, 119, 112, 136, 107, 110, 170, 120, 175, 142, 194, 75, 222, 152, 164, 180, 177, 184, 188, 135, 255, 210
Offset: 1
The first terms, alongside the means of consecutive terms ending with a(n), are:
n a(n) Corresponding means
- ---- ------------------------------------------
1 1 1
2 2 3/2, 2
3 4 7/3, 3, 4
4 7 7/2, 13/3, 11/2, 7
5 5 19/5, 9/2, 16/3, 6, 5
6 10 29/6, 28/5, 13/2, 22/3, 15/2, 10
7 12 41/7, 20/3, 38/5, 17/2, 9, 11, 12
8 18 59/8, 58/7, 28/3, 52/5, 45/4, 40/3, 15, 18
-
from fractions import Fraction
from itertools import count, islice
def agen(): # generator of terms
alst, means_seen = [1], {1}
while True:
yield alst[-1]
for k in count(1):
if k in means_seen: continue
mk, failed, sk = {k}, False, k
for j in range(1, len(alst)+1):
sk += alst[-j]
m = Fraction(sk, j+1)
if m in means_seen or m in mk: failed = True; break
mk.add(m)
if not failed: break
means_seen |= mk
alst.append(k)
print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 26 2024, Oct 28 2024
Showing 1-2 of 2 results.
Comments