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.

A372222 Numbers which have no imbalance when they are written in English and cut at the right place (see the definition of the imbalance in the Comments section).

Original entry on oeis.org

3, 41, 74, 130, 151, 155, 159, 168, 181, 198, 200, 205, 209, 227, 244, 252, 274, 282, 342, 353, 372, 383, 431, 445, 449, 454, 484, 485, 486, 489, 528, 533, 555, 559, 581, 585, 586, 589, 641, 645, 649, 654, 655, 656, 659, 681, 686, 708, 757, 761, 765, 769, 787, 791, 796, 823, 858, 888, 928, 933, 955, 959, 981, 985, 986, 989, 1004
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Jun 01 2024

Keywords

Comments

Take a number. Write this number in capital letters. Remove any spaces or hyphens to form a single block of contiguous letters. Cut this block into two parts using a vertical line which is tangent to at least one of the letters. The word ONE, for example, admits four cuts, the first before the O, the second between the O and the N, the third between the N and the E, the fourth after the E. These respective cuts produce the four pairs of subsets of following letters: —/ONE, O/NE, ON/E, ONE/—. A weight is now assigned to each subset. To do this, we replace each letter in the subset by its rank in the alphabet. Then we add up these ranks within the subset. The weights of the four successive pairs above are therefore {0;34}, {15;19}, {29;5}, {34;0}. The absolute difference of the two numbers that form such a pair is called imbalance. The successive imbalances in the example here are 34, 4, 24 and 34. As none is equal to zero, 1 ("ONE") is not part of the sequence.

Examples

			a(1) = 3 = THREE has no imbalance when cut between H and R as T+H = 28 = R+E+E;
a(2) = 41 = FORTYONE has no imbalance when cut between T and Y as F+O+R+T = 59 = Y+O+N+E;
a(3) = 74 = SEVENTYFOUR has no imbalance when cut between T and Y as S+E+V+E+N+T = 85 = Y+F+O+U+R; etc.
The cuts in the first integers of the sequence below are made using the equal (=) sign:
TH=REE (28=28)
FORT=YONE (59=59)
SEVENT=YFOUR (85=85)
ONEHUNDRE=DTHIRTY (104=104)
ONEHUNDRE=DFIFTYONE (104=104)
ONEHUNDRED=FIFTYFIVE (108=108)
ONEHUNDRED=FIFTYNINE (108=108)
ONEHUNDREDS=IXTYEIGHT (127=127)
ONEHUNDRED=EIGHTYONE (108=108)
ONEHUNDREDN=INETYEIGHT (122=122)
TWOH=UNDRED (66=66)
TWOHU=NDREDFIVE (87=87)
TWOHU=NDREDNINE (87=87)
TWOHUNDREDT=WENTYSEVEN (152=152)
TWOHUNDREDF=ORTYFOUR (138=138)
TWOHUNDRE=DFIFTYTWO (128=128)
TWOHUNDREDS=EVENTYFOUR (151=151)
TWOHUNDRED=EIGHTYTWO (132=132)
THREEHUNDREDF=ORTYTWO (136=136)
THREEHUNDRE=DFIFTYTHREE (126=126)
THREEHUNDREDS=EVENTYTWO (149=149)
THREEHUNDRED=EIGHTYTHREE (130=130)
FOURHUNDRED=THIRTYONE (134=134)
FOURHUNDRE=DFORTYFIVE (130=130)
FOURHUNDRE=DFORTYNINE (130=130)
FOURHUNDRE=DFIFTYFOUR (130=130)
FOURHUNDRED=EIGHTYFOUR (134=134)
FOURHUNDR=EDEIGHTYFIVE (125=125)
FOURHUNDRE=DEIGHTYSIX (130=130)
FOURHUNDR=EDEIGHTYNINE (125=125)
... etc.
		

Crossrefs

Programs

  • Python
    from num2words import num2words
    def n2w(n): return "".join(c for c in num2words(n).replace(" and", "") if c.isalpha())
    def ok(n):
        d = [ord(c) - ord('A') + 1 for c in n2w(n).upper()]
        if sum(d)%2 == 1: return False
        return any(sum(d[:i]) == sum(d[i:]) for i in range(1, len(d)))
    print([k for k in range(1005) if ok(k)]) # Michael S. Branicky, Jun 03 2024