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.

Showing 1-8 of 8 results.

A005589 Number of letters in the US English name of n, excluding spaces and hyphens.

Original entry on oeis.org

4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 7, 10, 10, 12, 11, 11, 10, 12, 12, 11, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 10, 13, 13, 15, 14, 14, 13, 15, 15, 14, 13, 16, 16, 18, 18, 17, 17, 19, 18, 18, 16
Offset: 0

Views

Author

Keywords

Comments

Diane Karloff observes (Nov 27 2007) that repeatedly applying the map k->A005589(k) to any starting value n always leads to 4 (cf. A016037, A133418).
The above observation was previously made in 1972 by R. Schroeppel and R. W. Gosper in HAKMEM (Item 134). - Bartlomiej Pawlik, Jun 12 2023
For terms beyond a(100), this sequence uses the US English style, "one hundred one" (not "one hundred and one"), and the short scale (a billion = 10^9, not 10^12). - M. F. Hasler, Nov 03 2013
Explanation of Diane Karloff's observation above: In many languages there exists a number N, after which all numbers are written with fewer letters than the number itself. N is 4 in English, German and Bulgarian, and 11 in Russian. If in the interval [1,N] there are numbers equal to the number of their letters, then they are attractors. In English and German the only attractor is 4, in Bulgarian 3, in Russian there are two, 3 and 11. In the interval [1,N] there may also exist loops of numbers, for instance 4 and 6 in Bulgarian (6 and 4 letters respectively) or 4,5 and 6 in Russian (6,4 and 5 letters respectively). There are no loops in English, therefore the above observation is true. - Ivan N. Ianakiev, Sep 20 2014

Examples

			Note that A052360(373373) = 64 whereas a(373373) = 56.
		

References

  • Problems Drive, Eureka, 37 (1974), 8-11 and 33.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A362123 for another version.
Cf. A007208 (analog for German).

Programs

  • Mathematica
    inWords[n_] := Module[{r,
    numNames = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"},
    teenNames = {"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"},
    tensNames = {"", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"},
    decimals = {"", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "quattuordecillion", "quindecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vigintillion", "unvigintillion", "duovigintillion", "trevigintillion", "quattuorvigintillion", "quinvigintillion", "sexvigintillion", "septenvigintillion", "octovigintillion", "novemvigintillion", "trigintillion", "untrigintillion", "duotrigintillion"}},
    r = If[# != 0, numNames[[# + 1]] <> "hundred"
    (* <> If[#2 != 0||#3 != 0," and",""] *),
    ""] <> Switch[#2, 0, numNames[[#3 + 1]], 1, teenNames[[#3 + 1]], _, tensNames[[#2 + 1]] <> numNames[[#3 + 1]]] & @@@
    (PadLeft[ FromDigits /@ Characters@ StringReverse@#, 3] & /@ StringCases[ StringReverse@ IntegerString@ n, RegularExpression["\\d{1,3}"]]);
    StringJoin@ Reverse@ MapThread[ If[# != "", StringJoin[##], ""] &, {r, Take[decimals, Length@ r]} ]]; (* modified for this sequence from what is presented in the link and good to 10^102 -1 *)
    f[n_] := StringLength@ inWords@ n; f[0] = 4; Array[f, 84, 0]
    (* Robert G. Wilson v, Nov 04 2007 and revised Mar 31 2015, small revision by Ivan Panchenko, Nov 10 2019 *)
    a[n_] := StringLength[ StringReplace[ IntegerName[n, "Words"], "," | " " | "\[Hyphen]" -> ""]]; a /@ Range[0, 83] (* Mma version >= 10, Giovanni Resta, Apr 10 2017 *)
  • PARI
    A005589(n, t=[10^12, #"trillion", 10^9, #"billion", 10^6, #"million", 1000, #"thousand", 100, #"hundred"])={ n>99 && forstep( i=1, #t, 2, n999 && error("n >= 10^",valuation(t[1],10)+3," requires extended 2nd argument"); return( A005589(n[1])+t[i+1]+if( n[2], A005589( n[2] )))); if( n<20, #(["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"][n+1]), #([ "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ][n\10-1])+if( n%10, A005589(n%10)))}  \\ Extension of 2nd arg to larger numbers is easy using the names listed in Mathematica section above. Only the string lengths are required, so it's easy to extend this list further without additional knowledge and without writing out the names. - M. F. Hasler, Jul 26 2011, minor edit on Jun 15 2021
    
  • Python
    from num2words import num2words
    def a(n):
        x = num2words(n).replace(' and ', '')
        l = [chr(i) for i in range(97, 123)]
        return sum(1 for i in x if i in l)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jul 05 2017

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Allan C. Wechsler, Mar 20 2000
Erroneous b-file deleted by N. J. A. Sloane, Sep 25 2008
More than the usual number of terms are shown in the DATA field to avoid confusion with A362123. - N. J. A. Sloane, Apr 20 2023

A167509 Least positive integer written with n different letters when spelled out in French.

Original entry on oeis.org

1, 6, 2, 3, 4, 17, 14, 22, 24, 53, 74, 92, 97
Offset: 2

Views

Author

M. F. Hasler, Nov 18 2009

Keywords

Comments

There is no number which can be written in French using only one letter, therefore the sequence starts at offset n=2, cf. examples.
A variant of the definition would be the "least nonnegative integer ....", in which case a(4)=0 ("zéro" with "accent aigu" on the "e"), all other terms remaining the same.
It appears that letters "j", "k" and "w" don't occur in any number, while "m" and "l" first occur in "mille" (=1000), and "b" first occurs in "billion".
If an "é" with accent (as it occurs in "décillion") is considered as different from "e" without accent, the sequence should have 26-3+1 terms.

Examples

			The terms a(2),...a(14) correspond to the French words un, six, deux, trois, quatre, dix-sept, quatorze, vingt-deux, vingt-quatre, cinquante-trois, soixante-quatorze, quatre-vingt-douze, quatre-vingt-dix-sept.
Here, "vingt-quatre" is the first term which contains a letter occurring twice, and therefore has a length greater than n; we conjecture that this is the case for all subsequent terms.
		

Crossrefs

Programs

Formula

a(n) = min { k | A167508(k) = n }

A168137 a(n) is the smallest number whose American English name contains n distinct letters of the alphabet; 3 <= n <= 23.

Original entry on oeis.org

1, 0, 8, 13, 14, 25, 24, 74, 112, 127, 125, 165, 265, 1265, 2568, 12468, 1002568, 1001002568, 1000001001002568, 1000000001000001001002568, 1001000000001000001001002568
Offset: 3

Views

Author

Andrew Weimholt, Nov 19 2009

Keywords

Comments

The letters j and k are unused and the letter z only appears in "zero", thus the maximum number of distinct letters possible is 23.
Note that in American English, it is improper to use the word "and" in the name of a number.
Wrong: "one hundred and one"
Right: "one hundred one"
Table of names for a(n)
...n...name..................................distinct letters used
.-----------------------------------------------------------------
...3...one...................................one
...4...zero..................................zero
...5...eight.................................eight
...6...thirteen..............................thiren
...7...fourteen..............................fourten
...8...twenty five...........................twenyfiv
...9...twenty four...........................twenyfour
..10...seventy four..........................sevntyfour
..11...one hundred twelve....................onehudrtwlv
..12...one hundred twenty seven..............onehudrtwysv
..13...one hundred twenty five...............onehudrtwyfiv
..14...one hundred sixty five................onehudrsixtyfv
..15...two hundred sixty five................twohundresixyfv
..16...one thousand two hundred
.........sixty five..........................onethusadwrixyfv
..17...two thousand five hundred
.........sixty eight.........................twohusandfiverxyg
..18...twelve thousand four hundred
.........sixty eight.........................twelvhousandfrixyg
..19...one million two thousand
.........five hundred sixty eight............onemiltwhusadfvrxyg
..20...one billion one million two
.........thousand five hundred sixty
.........eight...............................onebilmtwhusadfvrxyg
..21...one quadrillion one billion
.........one million two thousand
.........five hundred sixty eight............onequadrilbmtwhsfvxyg
..22...one septillion one quadrillion
.........one billion one million two
.........thousand five hundred sixty
.........eight...............................onesptilquadrbmwhfvxyg
..23...one octillion one septillion
.........one quadrillion one billion
.........one million two thousand five
.........hundred sixty eight.................onectilspquadrbmwhfvxyg

Examples

			a(5) = 8, because "eight" contains five distinct letters of the alphabet.
		

Crossrefs

A384131 Smallest positive number divisible by n that has n letters in US English, or 0 if none exists.

Original entry on oeis.org

6, 4, 40, 12, 70, 56, 36, 100, 33, 300, 1000000001, 406, 150, 112, 170, 162, 418, 11020, 336, 528, 828, 4800, 3300, 1404, 1620, 1512, 1218, 1770, 1147, 1344, 1353, 2788, 3325, 3888, 12728, 13376, 13338, 103360, 22878, 23478, 27778, 101728, 103725, 111734, 111578
Offset: 3

Views

Author

Jason Bard, May 20 2025

Keywords

Comments

The GCHQ reference uses British English (including "and"). The disagreements are at a(14)-a(16), which the book lists as 70000000, 15000, 14000. Furthermore, the book lists a(13) as impossible.

References

  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016 (see p. 47).

Crossrefs

Programs

  • Mathematica
    mmax = 10^10; Do[m = n; While[StringLength[StringDelete[IntegerName[m, "Words"], {" ", "-", "\[Hyphen]", ","}]] != n, m += n; If[m > mmax, m = 0; Break[]]]; Print[m], {n, 3, 43}]
  • Python
    from num2words import num2words
    from itertools import count, islice
    def b(n): return sum(1 for c in num2words(n).replace(" and", "") if c.isalpha())
    def a(n): return next(k for k in count(n, n) if b(k) == n)
    print([a(n) for n in range(3, 13)]) # Michael S. Branicky, May 20 2025

Formula

a(n) >= A134629(n). - Michael S. Branicky, May 21 2025

A132204 Sum of the numerical equivalents for the 23 Latin letters, according to Tartaglia, of the letters in the English name of n, excluding spaces and hyphens.

Original entry on oeis.org

2341, 351, 0, 940, 0, 296, 81, 665, 1011, 431, 500
Offset: 0

Views

Author

Jonathan Vos Post, Nov 19 2007

Keywords

Comments

Which are the fixed points n such that a(n) = n? Which n have prime a(n)? What are the equivalence classes of integers that have the same a(n)? Which n divide a(n)? Which n have a(n) that can be read as binary, as with a(8) = 1011? What is the sequence of n such that a(n) = 0 (i.e. the English name on n contains a J, U, or W)?
This sequence seems unnatural, since English uses three letters that were not in the Latin alphabet (W, U, J). A better sequence would first write the names of the numbers in Latin (cf. A132984) and then sum the values of the letters. - N. J. A. Sloane, Nov 30 2007

Examples

			a(0) = A132475(ZERO) = A132475(Z)+A132475(E)+A132475(R)+A132475(O) = 2000 + 250 + 80 + 11 = 2341.
a(1) = A132475(ONE) = A132475(O)+A132475(N)+A132475(E) = 11 + 90 + 250 = 351.
a(2) = 0 because "TWO" contains a "W" which is not one of Tartaglia's letters.
a(3) = A132475(THREE) = 160 + 200 + 80 + 250 + 250 = 940.
a(4) = 0 because "FOUR" contains a "U" which is not one of Tartaglia's letters.
a(5) = A132475(FIVE) = 40 + 1 + 5 + 250 = 296.
a(6) = A132475(SIX) = 70 + 1 + 10 = 81.
a(7) = A132475(SEVEN) = 70 + 250 + 5 + 250 + 90 = 665.
a(8) = A132475(EIGHT) = 250 + 1 + 400 + 200 + 160 = 1011.
a(9) = A132475(NINE) = 90 + 1 + 90 + 250 = 431.
a(10) = A132475(TEN) = 160 + 250 + 90 = 500 = A132475(Q).
		

Crossrefs

A132363 Least natural number in English which requires exactly n characters to spell including spaces and hyphens, or 0 if no such number exists. The inverse of A052360.

Original entry on oeis.org

1, 0, 3, 11, 15, 13, 17, 21, 24, 23, 73, 3000, 101, 104, 103, 111, 115, 113, 117, 121, 124, 123, 173, 323, 373, 1101, 1104, 1103, 1111, 1115, 1113, 1117, 1121, 1124, 1123, 1173, 1323, 1373, 3323, 3373, 11373, 13323, 13373, 17373, 21373, 23323, 23373, 73373
Offset: 3

Views

Author

Jonathan Vos Post, Nov 08 2007

Keywords

Comments

This is to A052360 as A134629 is to A005589. Also assumes no 'and' is used to spell integers. This deviates from A134629 at a(10). "twenty-one" is the smallest integer whose standard English name has a hyphen. "one hundred" is the smallest integer whose standard English name has a space. "one hundred twenty-one" is the smallest integer whose standard English name has a space and a hyphen.

Examples

			a(3) = 1 because "one" has 3 characters.
a(4) = 0 because "zero" has 4 characters.
a(5) = 3 because "three" has 5 characters.
a(6) = 11 because "eleven" has 6 characters.
a(7) = 15 because "fifteen" has 7 characters.
a(8) = 13 because "thirteen" has 8 characters.
a(9) = 17 because "seventeen" has 9 characters.
a(10) = 21 because "twenty-one" has 10 characters.
a(11) = 24 because "twenty-four" has 11 characters.
a(12) = 23 because "twenty-three" has 12 characters.
a(13) = 73 because "seventy-three" has 13 characters.
a(14) = 3000 because "three thousand" has 14 characters.
		

Crossrefs

Extensions

Corrected and extended by Martin Fuller, Nov 24 2007

A178823 a(1) = 1, a(n+1) = least k >= a(n) such that the sum of the number of letters in the English name of all values in the sequence through a(n), excluding spaces and hyphens (A005589), is prime.

Original entry on oeis.org

1, 4, 5, 11, 12, 13, 24, 73, 1103, 1115, 1117, 1117, 1117, 1117, 1117, 1140, 1144, 1201, 1217, 1217, 1323, 1326, 1340, 1344, 1374, 1413, 1413, 1413, 1413, 1424, 1441, 1441, 1480, 1484
Offset: 1

Views

Author

Jonathan Vos Post, Dec 26 2010

Keywords

Examples

			a(1) = 1 by definition.
a(2) = 4 because "one" plus "four" has 3 + 4 = 7 letters, with 7 prime.
a(3) = 5 because "one" plus "four" plus "five" gives 3 + 4 + 4 = 11, a prime.
a(4) = 11 because "one" plus "four" plus "five" plus "eleven" gives 3 + 4 + 4 + 6 = 17 is prime.
a(5) = 12 because "one" plus "four" plus "five" plus "eleven" plus "twelve" gives 3 + 4 + 4 + 6 + 6 = 23 is prime.
a(6) = 13 because "one" plus "four" plus "five" plus "eleven" plus "twelve" plus "thirteen" gives 3 + 4 + 4 + 6 + 6 + 8 = 31 is prime.
a(7) = 24 because "one" plus "four" plus "five" plus "eleven" plus "twelve" plus "thirteen" plus "twentyfour" gives 3 + 4 + 4 + 6 + 6 + 8 + 10 = 41 is prime.
a(8) = 73 because "one" plus "four" plus "five" plus "eleven" plus "twelve" plus "thirteen" plus "twentyfour" plus "seventythree" gives 3 + 4 + 4 + 6 + 6 + 8 + 10 + 12 = 53 is prime.
a(9) = 1103 because "one" plus "four" plus "five" plus "eleven" plus "twelve" plus "thirteen" plus "twentyfour" plus "seventythree" plus "one thousand one hundred three" gives 3 + 4 + 4 + 6 + 6 + 8 + 10 + 12 + 26 = 79 is prime.
a(10) = 1115 "one" plus "four" plus "five" plus "eleven" plus "twelve" plus "thirteen" plus "twentyfour" plus "seventythree" plus "one thousand one hundred three" plus "one thousand one hundred fifteen" gives 3 + 4 + 4 + 6 + 6 + 8 + 10 + 12 + 26 + 28 = 107 is prime.
		

Crossrefs

Extensions

a(11)-a(34) from Nathaniel Johnston, Jan 04 2011

A305100 Least nonnegative integer which requires n letters to spell in Turkish excluding spaces and hyphens.

Original entry on oeis.org

3, 1, 4, 0, 14, 18, 21, 24, 28, 68, 124, 128, 168, 224, 228, 268, 468, 868, 1268, 1468, 1868, 2268, 2468, 2868, 4868, 8868, 14868, 18868, 21868, 24868, 28868, 68868, 124868, 128868, 168868, 224868, 228868, 268868, 468868, 868868, 1068868, 1124868, 1128868, 1168868
Offset: 2

Views

Author

Sezai Ata, May 25 2018

Keywords

Examples

			a(2) = 3: "üç", a(3) = 1: "bir", a(5) = 0: "sıfır"
		

Crossrefs

Turkish version of A134629.
Cf. A057435.

Programs

  • Python
    from num2words import num2words
    from itertools import count, islice
    def f(n): return sum(1 for c in num2words(n, lang='tr') if c.isalpha())
    def agen(): # generator of terms
        n, adict = 2, dict()
        for k in count(0):
            v = f(k)
            if v not in adict:
                adict[v] = k
                while n in adict:
                    yield adict[n]
                    n += 1
    print(list(islice(agen(), 44))) # Michael S. Branicky, Sep 01 2025

Extensions

a(16)-a(41) from Daniel Suteu, May 26 2018
a(42)-a(45) from Michael S. Branicky, Sep 01 2025
Showing 1-8 of 8 results.