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.

A052360 Number of characters in the English name of n, including 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, 10, 10, 12, 11, 11, 10, 12, 12, 11, 6, 10, 10, 12, 11, 11, 10, 12, 12, 11, 5, 9, 9, 11, 10, 10, 9, 11, 11, 10, 5, 9, 9, 11, 10, 10, 9, 11, 11, 10, 5, 9, 9, 11, 10, 10, 9, 11, 11, 10, 7, 11, 11, 13, 12, 12, 11, 13
Offset: 0

Views

Author

Allan C. Wechsler, Mar 07 2000

Keywords

Comments

See A007005 for the French analog, and A167507 for the "count letters only" variant (analog of A005589). - M. F. Hasler, Sep 20 2014

Examples

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

Crossrefs

Programs

  • Maple
    a:= n-> length(convert(n, english)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 30 2023
  • PARI
    English(n, pot=[10^9,"billion", 10^6,"million", 1000,"thousand", 100,"hundred"])={ n>99 && forstep( i=1,#pot,2, n999 && error("n >= 1000 ",pot[2]," not yet implemented");
    return( Str( English(n[1])," ",pot[i+1], if( n[2], Str(" ",English(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],
      Str([ "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ][n\10-1], if( n%10, Str("-",English(n%10)),"")))}
    A052360(n)=#English(n)  \\ M. F. Hasler, Jul 26 2011
    
  • Python
    from num2words import num2words
    def a(n): return len(num2words(n).replace(" and", "").replace(chr(44), ""))
    print([a(n) for n in range(78)]) # Michael S. Branicky, Jul 12 2022

Extensions

Minor edits by Ray Chandler, Jul 22 2009

A167507 Number of letters in the French spelling of the number n, not counting hyphens and spaces.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 18 2009

Keywords

Comments

Sequence A007005 is a variant of this sequence, where spaces and hyphens are counted.
In most languages, there exists a number N after which all numbers are written with fewer letters than the number itself. In English, in German and in French, N = 4. Here, if n > 4, then a(n) < n, and if n <= 4, then a(n) > n. - Bernard Schott, Jan 11 2019

Examples

			The terms a(0),...,a(16) represent the number of characters in the strings "zéro", "un", "deux", "trois", "quatre", "cinq", "six", "sept", "huit", "neuf", "dix", "onze", "douze", "treize", "quatorze", "quinze", "seize".
Since spaces and punctuation are not counted, a(n) is less than the length of the character string whenever the spelling of n contains hyphens, as in "dix-sept" (a(17)=7), or spaces as in "vingt et un" (a(21)=9).
		

Crossrefs

Cf. A005589 (English analog), A167508 (counts distinct letters).
Cf. A001050 (Finnish analog), A006994 (Russian analog), A007208 (German analog), A011762 (Spanish analog), A026858 (Italian analog).

Programs

  • PARI
    apply( {A167507(n)=#[0|c<-Vecsmall(French(n)), c>96]}, [0..81]) \\ updated by M. F. Hasler, Feb 19 2020 [If old versions of PARI/gp give an error, use e.g. Vec(Vecsmall...).]
    /* Helper function: spell out n in French. Extended to 10^24 (now further extensible via the 2nd optional argument) for A204593 on Feb 16 2012. */
    French(n, t=[10^18,"trillion", /*10^15,"billiard",*/ 10^12,"billion", 10^9,"milliard", 10^6,"million"])={ if( n>999, n>=10^6*t[1] & error(n" is too large - this implementation is restricted to n < 10^",5+#Str(t[1])); forstep(i=1,#t,2, n\t[i] & return(Str(French(n\t[i])" "t[i+1], if(n\t[i]>1,"s",""), if(n%t[i],Str(" "French(n%t[i])),"")))); return(Str(if(n\1000>1,Str(French(n\1000)," "),""),"mille",if(n%1000,Str(" ", French(n%1000)),""))));
    n<20 & return([ "zero","un","deux","trois","quatre","cinq","six","sept","huit","neuf", "dix","onze", "douze","treize","quatorze","quinze","seize","dix-sept","dix-huit","dix-neuf"][n+1]);
    n >= 100 & return( Str( if( n>199, Str(French(n\100)," "), ""), "cent", if(n%100,Str(" ",French(n%100)),if(n>199,"s","")/*deux cents*/)));
    n > 80 & return( Str( "quatre-vingt-", French( n-80 )));
    n%10==0 & return( Str( ["vingt","trente","quarante","cinquante","soixante", "soixante-dix","quatre-vingts"][n\10-1] ));
    Str( French((n\10-(n>70))*10), if(n%10==1," et ","-"), French(n%10+10*(n>70)))}
    \\ M. F. Hasler, Nov 19 2009

Extensions

Keyword "fini" removed by M. F. Hasler, Nov 19 2009
a(80) and a(81) corrected by Bernard Schott, Feb 19 2020

A007208 Number of letters in German name of n.

Original entry on oeis.org

4, 4, 4, 4, 4, 4, 5, 6, 4, 4, 4, 3, 5, 8, 8, 8, 8, 8, 8, 8, 7, 13, 14, 14, 14, 14, 15, 16, 14, 14, 7, 13, 14, 14, 14, 14, 15, 16, 14, 14, 7, 13, 14, 14, 14, 14, 15, 16, 14, 14, 7, 13, 14, 14, 14, 14, 15, 16, 14, 14, 7, 13, 14, 14, 14, 14, 15, 16, 14, 14, 7
Offset: 0

Views

Author

Keywords

Comments

Standard German orthography; a letter with an umlaut or ß is counted as a single letter: e.g., 30 maps to length("dreißig") = 7.
There are ambiguities from n=100 on, since both, "hundert" and "einhundert" are equally valid and common. The same applies for 1000 with "tausend" or "eintausend". - M. F. Hasler, Nov 03 2013
In contrast to English (A005589 vs A052360) and French (A007005 vs A167507), there are no spaces or other punctuation in German names for numbers, until 10^6 = "eine Million". - M. F. Hasler, Sep 20 2014
There also appears to be an ambiguity on whether there is an 's' in the middle of 101*10^3, "(ein)hundertein(s)tausend". - M. F. Hasler, Apr 08 2023

References

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

Crossrefs

Cf. A005589 and A052360 (English analog).
Cf. A007005 and A167507 (French analog).

Programs

  • PARI
    /* Because names with ä, ö, ü or ß can't be entered directly as a string in the GP interface, we use a separate list for the names, for efficiency and readability of the main function. Note that the default lexicographical order is that of ISO 8859-1 character codes ("z" < "ß" < "ä"). In applications where this is not suitable, the special characters below can be replaced, e.g., with "ae, oe, ue, ss" or "a, o, u, s". [M. F. Hasler, Jul 05 2024] */
    {deutsch = ["eins", "zwei", "drei", "vier", Str("f"Strchr(252)"nf"), "sechs", "sieben", "acht", "neun", "zehn", "elf", Str("zw"Strchr(246)"lf"),  "dreizehn", "vierzehn", Str("f"Strchr(252)"nfzehn"), "sechzehn", "siebzehn", "achtzehn", "neunzehn", "zwanzig", Str("drei"Strchr(223)"ig"), "vierzig", Str("f"Strchr(252)"nfzig"), "sechzig", "siebzig", "achtzig", "neunzig"]}
    German(n, e="eins", power=0, name="")={ if(power /* internal helper function */
      , n = divrem(n, power); Str(German(n[1], e) name, if(n[2], German(n[2]), ""))
      , n < 20, if(n>1, deutsch[n], n, e, "null")
      , n < 100, Str(if(n%10, Str(German(n%10, "ein") "und"), "") deutsch[n\10+18])
      , n < 1000, German(n, "ein", 100, "hundert") \\ replace "ein" with "" to get
      , n < 10^6, German(n, "ein", 1000, "tausend")\\ hundert/tausend without "ein-"
      , my(t=3); while(n>=10^t, t+=3); German(n, "ein", 10^t-=3, strprintf(
          if(n\10^t>1, " %sen", t%2, "e %se", "e %s")  if(n%10^t, " ", ""),
          Str(["M", "B", "Tr", "Quadr", "Quint", "Sext", "Sept", "Oct", "Non",
               "Dez", "Undez" /* etc. */][t\6], "illi", ["on", "ard"][t%2+1])))
      )} \\ updated Mar 03 2020, Apr 08 2023, Jul 05 2024
    A007208 = n -> #German(n) \\ M. F. Hasler, Nov 01 2013
    A007208(n) = vecsum([c>32|c<-Vecsmall(German(n))]) \\ To exclude spaces; irrelevant for n < 10^6. - M. F. Hasler, Jul 05 2024

Extensions

Corrected by Markus Stausberg (markus(AT)polomi.de), Aug 08 2004
Initial term a(0) = 4 = #"null" added by M. F. Hasler, Nov 01 2013

A014254 Liponombres: numbers whose French name does not contain the letter "e".

Original entry on oeis.org

1, 3, 5, 6, 8, 10, 18, 20, 23, 25, 26, 28, 1000000, 1000001, 1000003, 1000005, 1000006, 1000008, 1000010, 1000018, 1000020, 1000023, 1000025, 1000026, 1000028, 3000000, 3000001, 3000003, 3000005, 3000006, 3000008, 3000010
Offset: 1

Views

Author

Keywords

Comments

In French also called: les nombres "évites" ou "apparés".
Could also be called les nombres "epers". - Benoit Cloitre, May 05 2003
French version of eban numbers (A006933): no "e" in name of number in French - "e" perd ("e" lost)!

Examples

			a(1) = 1 ("un"), a(2) = 3 ("trois", not "dEux")
		

References

  • Georges Perec, La disparition, Editions Gallimard, Paris, 1969; English translation: A Void, Harvill, 1994. (A novel that does not use the letter "e". These numbers are not mentioned, however.)

Crossrefs

Programs

Extensions

Additional comments from Bruno Salvy (Bruno.Salvy(AT)inria.fr) and Nicolas Graner (Nicolas.Graner(AT)cri.u-psud.fr), May 11 2003
Corrected by Don Reble, Nov 19 2006
Edited by M. F. Hasler, Nov 11 2015

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

A061504 a(1) = 1; for n>1, a(n) = numbers of letters in French name for a(n-1).

Original entry on oeis.org

1, 2, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4, 6, 3, 5, 4
Offset: 1

Views

Author

N. J. A. Sloane, Jun 14 2001

Keywords

Comments

a(n+1) = le nombre des lettres dans a(n), a(1) = 1 (in French).
The English (1, 3, 5, 4, 4, 4, ...) and German (1, 4, 4, 4, ...) versions are less interesting.
Decimal expansion of 13847/11110 = 1.24635463546354635... - Eric Angelini, Sep 17 2006; corrected by Elmo R. Oliveira, Jun 29 2024

Examples

			Un, deux, quatre, six, trois, cinq, quatre, ...
UN (2 letters), DEUX (4 letters), QUATRE (6 letters), SIX (3 letters), TROIS (5 letters), CINQ (4 letters), QUATRE (6 letters), ...
		

Crossrefs

Cf. A007005 (number of letters).
Cf. A000655 (English), A101432 (Spanish), A328263 (Polish).

Formula

From Elmo R. Oliveira, Jun 29 2024: (Start)
G.f.: x*(1+2*x+4*x^2+6*x^3+2*x^4+3*x^5)/(1-x^4).
a(n) = a(n-4) for n > 6. (End)

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 08 2007

A305403 Number of Ukrainian letters in Ukrainian name of n.

Original entry on oeis.org

4, 4, 3, 3, 6, 4, 5, 3, 5, 6, 6, 10, 10, 10, 12, 10, 11, 10, 12, 12, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 5, 9, 8, 8, 11, 9, 10, 8, 10, 11, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 9, 13, 12, 12, 15, 13, 14, 12, 14, 15, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 10, 14, 13
Offset: 0

Views

Author

Felix Fröhlich, May 31 2018

Keywords

Comments

Apostrophes, when the name is written with Ukrainian letters, are not counted as letters. If they were, then, for example, a(5) would be 5, but here, a(5) = 4, because the apostrophe is ignored.

Examples

			Using the BGN/PCGN romanization system, the names of numbers are nul', odyn, dva, try, chotyry, .... Note that the number of letters in the romanized name of n does not necessarily coincide with the number of letters when the name of n is written in Ukrainian script.
		

Crossrefs

Cf. A005589 (English), A007005 (French), A026858 (Italian), A006994 (Russian), A011762 (Spanish).

Programs

  • Mathematica
    (* only works up to 999999 *)
    upto20 = {0, 4, 3, 3, 6, 4, 5, 3, 5, 6, 6, 10, 10, 10, 12, 10, 11, 10, 12, 12, 8}
    tens = {0, 6, 8, 8, 5, 8, 9, 8, 10, 9}
    hundreds = {0, 3, 6, 6, 9, 6, 7, 6, 8, 8}
    thousands = {0, 10, 9, 9, 12}
    f[x_] := If[x == 0, 4, If[x > 999 && x < 5000, thousands[[Quotient[x, 1000] + 1]] + f[Mod[x, 1000]],
      If[
        x < 1000,
        If[Mod[x, 100] <= 20, upto20[[Mod[x, 100] + 1]], upto20[[Mod[x, 10] + 1]] + tens[[Mod[Quotient[x, 10], 10] + 1]]] + hundreds[[Mod[Quotient[x, 100], 10] + 1]] + thousands[[Mod[Quotient[x, 1000], 10] + 1]],
        5 + f[Quotient[x, 1000]] + If[Mod[x, 1000] == 0, 0, f[Mod[x, 1000]]]
      ]
    ]]
    For[i = 0, i <= 10000, i++,
      j = 0;
      Print[i, " ", f[i]]
    ] (* E-Hern Lee, Jul 11 2018 *)

Extensions

More terms from E-Hern Lee, Jul 11 2018
Showing 1-7 of 7 results.