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.

A362121 a(n) is the smallest nonnegative number whose British English name has the letter "e" in the n-th position.

This page as a plain text file.
%I A362121 #11 Apr 21 2023 11:37:54
%S A362121 8,0,1,3,3,12,13,17,21,23,23,73,1700,108,107,101,103,103,112,113,117,
%T A362121 121,123,123,173,323,373,1103,1103,1112,1113,1117,1121,1123,1123,1173,
%U A362121 1323,1373,3323,3373,11373,13323,13373,17373,23323,23373,73373,101123,101173
%N A362121 a(n) is the smallest nonnegative number whose British English name has the letter "e" in the n-th position.
%D A362121 GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 70.
%o A362121 (Python)
%o A362121 from num2words import num2words
%o A362121 from itertools import count, islice
%o A362121 def n2w(n):
%o A362121     return "".join(c for c in num2words(n, lang='en_GB') if c.isalpha())
%o A362121 def A362121(n, t="e", i0=0): # t is target letter, i0 is start
%o A362121     return next(i for i in count(i0) if len(w:=n2w(i))>=n and w[n-1]==t)
%o A362121 print([A362121(n) for n in range(1, 31)]) # _Michael S. Branicky_, Apr 21 2023
%o A362121 (Python) # faster for initial segment of sequence; uses n2w, imports above
%o A362121 def A362121gen(t="e", i0=0, offset=1): # generator of terms w
%o A362121     adict, n = dict(), offset
%o A362121     for i in count(i0):
%o A362121         w = n2w(i)
%o A362121         if t in w:
%o A362121             locs = [i+1 for i, c in enumerate(w) if w[i] == t]
%o A362121             for v in locs:
%o A362121                 if v not in adict: adict[v] = i
%o A362121         while n in adict: yield adict[n]; n += 1
%o A362121 print(list(islice(A362121gen(), 50))) # _Michael S. Branicky_, Apr 21 2023
%Y A362121 See A164790, A362120, and A362122 for other versions.
%K A362121 nonn,word
%O A362121 1,1
%A A362121 _N. J. A. Sloane_, Apr 20 2023
%E A362121 a(14) and beyond from _Michael S. Branicky_, Apr 21 2023