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).

This page as a plain text file.
%I A372222 #29 Jun 03 2024 18:23:53
%S A372222 3,41,74,130,151,155,159,168,181,198,200,205,209,227,244,252,274,282,
%T A372222 342,353,372,383,431,445,449,454,484,485,486,489,528,533,555,559,581,
%U A372222 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
%N 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).
%C A372222 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.
%e A372222 a(1) = 3 = THREE has no imbalance when cut between H and R as T+H = 28 = R+E+E;
%e A372222 a(2) = 41 = FORTYONE has no imbalance when cut between T and Y as F+O+R+T = 59 = Y+O+N+E;
%e A372222 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.
%e A372222 The cuts in the first integers of the sequence below are made using the equal (=) sign:
%e A372222 TH=REE (28=28)
%e A372222 FORT=YONE (59=59)
%e A372222 SEVENT=YFOUR (85=85)
%e A372222 ONEHUNDRE=DTHIRTY (104=104)
%e A372222 ONEHUNDRE=DFIFTYONE (104=104)
%e A372222 ONEHUNDRED=FIFTYFIVE (108=108)
%e A372222 ONEHUNDRED=FIFTYNINE (108=108)
%e A372222 ONEHUNDREDS=IXTYEIGHT (127=127)
%e A372222 ONEHUNDRED=EIGHTYONE (108=108)
%e A372222 ONEHUNDREDN=INETYEIGHT (122=122)
%e A372222 TWOH=UNDRED (66=66)
%e A372222 TWOHU=NDREDFIVE (87=87)
%e A372222 TWOHU=NDREDNINE (87=87)
%e A372222 TWOHUNDREDT=WENTYSEVEN (152=152)
%e A372222 TWOHUNDREDF=ORTYFOUR (138=138)
%e A372222 TWOHUNDRE=DFIFTYTWO (128=128)
%e A372222 TWOHUNDREDS=EVENTYFOUR (151=151)
%e A372222 TWOHUNDRED=EIGHTYTWO (132=132)
%e A372222 THREEHUNDREDF=ORTYTWO (136=136)
%e A372222 THREEHUNDRE=DFIFTYTHREE (126=126)
%e A372222 THREEHUNDREDS=EVENTYTWO (149=149)
%e A372222 THREEHUNDRED=EIGHTYTHREE (130=130)
%e A372222 FOURHUNDRED=THIRTYONE (134=134)
%e A372222 FOURHUNDRE=DFORTYFIVE (130=130)
%e A372222 FOURHUNDRE=DFORTYNINE (130=130)
%e A372222 FOURHUNDRE=DFIFTYFOUR (130=130)
%e A372222 FOURHUNDRED=EIGHTYFOUR (134=134)
%e A372222 FOURHUNDR=EDEIGHTYFIVE (125=125)
%e A372222 FOURHUNDRE=DEIGHTYSIX (130=130)
%e A372222 FOURHUNDR=EDEIGHTYNINE (125=125)
%e A372222 ... etc.
%o A372222 (Python)
%o A372222 from num2words import num2words
%o A372222 def n2w(n): return "".join(c for c in num2words(n).replace(" and", "") if c.isalpha())
%o A372222 def ok(n):
%o A372222     d = [ord(c) - ord('A') + 1 for c in n2w(n).upper()]
%o A372222     if sum(d)%2 == 1: return False
%o A372222     return any(sum(d[:i]) == sum(d[i:]) for i in range(1, len(d)))
%o A372222 print([k for k in range(1005) if ok(k)]) # _Michael S. Branicky_, Jun 03 2024
%Y A372222 Cf. A104059, A373321, A373317, A083967.
%K A372222 base,nonn,word
%O A372222 1,1
%A A372222 _Eric Angelini_ and _Jean-Marc Falcoz_, Jun 01 2024