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-7 of 7 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

A006969 Number of characters in French ordinal numbers.

Original entry on oeis.org

7, 8, 9, 9, 9, 7, 8, 8, 8, 7, 7, 8, 9, 11, 9, 8, 12, 12, 12, 9, 15, 14, 15, 15, 15, 13, 14, 14, 14, 9, 16, 15, 16, 16, 16, 14, 15, 15, 15, 11, 18, 17, 18, 18, 18, 16, 17, 17, 17, 12, 19, 18
Offset: 1

Views

Author

Keywords

Comments

Nombres de caractères (lettres, espaces et tirets) des nombres ordinaux en français.
In contrast to A196278, hyphens and spaces are counted here. First differs at n = 17 (dix-septième). - Georg Fischer, Aug 07 2021
In French the final -s in "quatre-vingts", "deux cents", ... disappears when the ordinal suffix "-ième" is appended. (This is currently incorrectly handled in the Python module num2words.) Also, the trailing "-e" of numbers ending in "quatre", "onze" - "seize", "trente" - "soixante" disappears. Therefore, in all these cases the name of the ordinal has only 3 letters more than the name of the cardinal, viz. a(n) = A007005(n)+3. For numbers ending in "cinq", there appears an additional "u", whence a(n) = A007005(n)+5 in this case. - M. F. Hasler, Aug 08 2021

Examples

			a(21) = # "vingt-et-unième" = 15, where # means length of the string.
a(50) = # "cinquantième" = 12.
a(80) = # "quatre-vingtième": the '-s' disappears from "quatre-vingts".
a(200) = # "deux-centième": the '-s' disappears from "deux cents".
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006944 (in American English), A196278 (similar, but not counting spaces and hyphens).
Cf. A007005, A167507 (number of letters/characters in French name of n).

Programs

  • PARI
    apply( {A006969(n, t=French(n))=#t+if(n==1||"nq"==t=Strchr(Vecsmall(t)[-2..-1]), 5, "ts"==t || Vec(t)[2]=="e", 3, 4)}, [1..55]) \\ See A007005 for French(). - M. F. Hasler, Aug 08 2021

Formula

a(n) = A007005(n) + e, where e = 4 except for n = 1 and when the French name of n ends in "cinq" (then e = 5), or when it ends in "-e" or "-ts" (then e = 3). - M. F. Hasler, Aug 08 2021

Extensions

Edited by M. F. Hasler, Aug 08 2021

A196278 Number of letters in the French ordinal numbers.

Original entry on oeis.org

7, 8, 9, 9, 9, 7, 8, 8, 8, 7, 7, 8, 9, 11, 9, 8, 11, 11, 11, 9, 13, 13, 14, 14, 14, 12, 13, 13, 13, 9, 14, 14, 15, 15, 15, 13, 14, 14, 14, 11, 16, 16, 17, 17, 17, 15, 16, 16, 16, 12, 17, 17, 18, 18, 18, 16, 17, 17, 17, 11, 16, 16, 17, 17, 17, 15, 16, 16, 16, 15, 17, 16, 17, 19, 17, 16, 19, 19, 19, 15, 17, 19, 20, 20, 20, 18, 19, 19, 19, 18, 18, 19, 20, 22, 20, 19, 22, 22, 22, 8
Offset: 1

Views

Author

M. F. Hasler, Sep 30 2011

Keywords

Comments

The first term corresponds to the masculine form "premier"; it could as well have been chosen to be "première". In contrast to A006969, hyphens and spaces are not counted. First differs at n = 17, where the hyphen in "dix-septième" is not counted here, but there.
It would be nice to have short programs in various languages to spell out the n-th ordinal number in French.

Examples

			a(1) = #"premier" = 7, a(2) = #"deuxième" = 8, a(3) = #"troisième" = 9,
a(4) = #"quatrième" = 9, a(5) = #"cinquième" = 9, a(6) = #"sixième" = 7, etc.
a(80) = 15, the number of letters in "quatre-vingtième". - _M. F. Hasler_, Aug 08 2021
		

Crossrefs

Cf. A006944 (in American English).

A058230 Numbers k such that the product of the lengths of the words in the name of k in American English is equal to k.

Original entry on oeis.org

4, 24, 84672, 1852200, 829785600, 20910597120, 92215733299200, 1239789303244800000, 887165996513213819259682435576627200000000
Offset: 1

Views

Author

Michael Kleber, Dec 01 2000

Keywords

Comments

This sequence uses American English spellings; e.g., 84672 ends in "six hundred seventy-two", not "six hundred and seventy-two" (cf. A006944). Also, for purposes of this sequence, hyphens are treated as spaces, so "seventy-two" is counted as two words ("seventy two"). - Jon E. Schoenfield, Nov 18 2018
a(10) > 10^138 if it exists. - Jonathan Pappas, Mar 12 2021

Examples

			84672 = "eighty four thousand six hundred seventy two" = 6*4*8*3*7*7*3 = 84672.
		

Programs

  • Mathematica
    Select[Range[10^5],Times@@StringLength/@StringSplit[StringReplace[#~IntegerName~"Words",{","->"","-"->" "}]]==#&] (* Giorgos Kalogeropoulos, Mar 20 2021 *)
  • Python
    #  See Python program link.
    # Jonathan Pappas, Mar 12 2021

Extensions

a(7)-a(9) from Jonathan Pappas, Mar 12 2021

A372204 a(n) is the number of letters in the Italian name of the n-th ordinal number.

Original entry on oeis.org

5, 7, 5, 6, 6, 5, 7, 6, 4, 6, 10, 10, 11, 15, 12, 10, 15, 12, 14, 9, 11, 12, 13, 16, 15, 13, 14, 12, 13, 10, 12, 13, 14, 17, 16, 14, 15, 13, 14, 12, 14, 15, 16, 19, 18, 16, 17, 15, 16, 13, 15, 16, 17, 20, 19, 17, 18, 16, 17, 12, 14, 15, 16, 19, 18, 16, 17, 15, 16, 12
Offset: 1

Views

Author

Stefano Spezia, Apr 27 2024

Keywords

Examples

			Primo, secondo, terzo, quarto, quinto, sesto, settimo, ottavo, nono, ...
		

Crossrefs

Programs

  • Python
    from num2words import num2words
    def A372204(n): return len(num2words(n,ordinal=True,lang='it')) # Chai Wah Wu, Apr 28 2024

Extensions

a(17), a(19) corrected by Chai Wah Wu, Apr 28 2024

A131998 Numbers m such that the number of letters in the m-th ordinal number divides m.

Original entry on oeis.org

5, 7, 10, 24, 33, 40, 44, 70, 78, 84, 90, 99, 105, 126, 132, 168, 176, 189, 190, 198, 208, 210, 231, 252, 306, 315, 340, 360, 368, 384, 391, 408, 420, 441, 462, 480, 520, 546, 575, 580, 598, 600, 608, 612, 638, 682, 693, 700, 702, 736, 740, 760, 770, 792, 814
Offset: 1

Views

Author

Jonathan Vos Post, Oct 08 2007

Keywords

Comments

Which numbers k occur as the dividends?
k smallest n such that A006944(n)/n = k
1 5
2 10
3 11
4 44
5 never?
6 78
7 70
8 168
9 189
10 90
11 99

Examples

			a(1) = 5 because "fifth" has 5 letters.
a(2) = 7 because "seventh" has 7 letters.
a(3) = 10 because "tenth" has 5 letters and 10/5 = 2.
a(4) = 24 because "twentyfourth" has 12 letters and 24/12 = 2.
a(5) = 33 because "thirtythird" has 11 letters and 33/11 = 3.
a(6) = 44 because "fortyfourth" has 11 letters and 44/11 = 4.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[814],Divisible[#,Length[Select[Characters[IntegerName[#,"Ordinal"]],LetterQ]]]&] (* James C. McMahon, Mar 02 2025 *)

Formula

{n such that A006944(n)|n}.

Extensions

Corrected and extended by R. J. Mathar, Oct 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
Showing 1-7 of 7 results.