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-4 of 4 results.

A345240 a(1) = 1; thereafter a(n) = A161406(a(n-1)).

Original entry on oeis.org

1, 52, 158, 229, 278, 284, 304, 235, 289, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298, 291, 300, 153, 251, 298
Offset: 1

Views

Author

Omar E. Pol and N. J. A. Sloane, Jun 11 2021

Keywords

Comments

A Spanish analog of A345126 (British English) and A345157 (US English).
Starting from n = 10 the sequence becomes periodic with period 5: repeat [291, 300, 153, 251, 298].

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=Total[If[#=="ñ",15,If[(s=LetterNumber@#)>14,s+1,s]]&/@Characters@StringDelete[IntegerName[a[n-1],"Spanish"],{" ","-"}]];Array[a,100] (* Giorgos Kalogeropoulos, Jun 11 2021 *)
    PadRight[{1,52,158,229,278,284,304,235,289},120,{300,153,251,298,291}] (* Harvey P. Dale, Sep 26 2024 *)

A073327 Write U.S. English name for n (ignoring hyphens and spaces) and add numerical values of letters using a=1, b=2, ..., y=25, z=26.

Original entry on oeis.org

64, 34, 58, 56, 60, 42, 52, 65, 49, 42, 39, 63, 87, 99, 104, 65, 96, 109, 73, 86, 107, 141, 165, 163, 167, 149, 159, 172, 156, 149, 100, 134, 158, 156, 160, 142, 152, 165, 149, 142, 84, 118, 142, 140, 144, 126, 136, 149, 133, 126, 66, 100, 124, 122, 126, 108, 118
Offset: 0

Views

Author

Paul Lusch, Aug 22 2002

Keywords

Comments

In writing out the names for these numbers, "and" is not used in U.S. English; e.g., 101 is rendered as "one hundred one" rather than "one hundred and one". - Robert Israel, Jun 12 2019
The British English version is too similar to this to have its own entry. They first differ at n=101, where here a(101) = 142, whereas in British English 101 is "one hundred and one", which is 161. - N. J. A. Sloane, Jun 09 2021
From Robert Israel's data it appears that the U.S. version has no fixed points, and the British version has exactly two fixed points, at 251 and 259. I do not know if either version has cycles of length >= 2 apart from the cycles of length 5 that are visible in A345126 and A345157. - N. J. A. Sloane, Jun 11 2021

Examples

			"One" = 15 + 14 + 5 = 34 (o is 15th letter, n is 14th letter, e is 5th letter).
From _Omar E. Pol_, Jun 15 2021: (Start)
-----------------------------------------------------
   n      Name      Calculation                  a(n)
-----------------------------------------------------
   0      Zero      26 +  5 + 18 + 15           = 64
   1      One       15 + 14 +  5                = 34
   2      Two       20 + 23 + 15                = 58
   3      Three     20 +  8 + 18 +  5 +  5      = 56
   4      Four       6 + 15 + 21 + 18           = 60
   5      Five       6 +  9 + 22 +  5           = 42
   6      Six       19 +  9 + 24                = 52
   7      Seven     19 +  5 + 22 +  5 + 14      = 65
   8      Eight      5 +  9 +  7 +  8 + 20      = 49
   9      Nine      14 +  9 + 14 +  5           = 42
  10      Ten       20 +  5 + 14                = 39
  11      Eleven     5 + 12 +  5 + 22 +  5 + 14 = 63
  12      Twelve    20 + 23 +  5 + 12 + 22 +  5 = 87
... (End)
		

Crossrefs

Row sums of A073029.
For analogs in other languages see A169639 (French), A119945 (German), A161406 (Spanish).

Programs

  • Maple
    # Maple program for US English
    f:= proc(n) local S;
       uses StringTools;
      S:= Select(IsAlpha,convert(n,english));
      convert(map(`-`,convert(S,bytes),96),`+`)
    end proc:
    map(f, [$0..100]); # Robert Israel, Jun 12 2019
    # British English version, valid for n < 10^9
    f:= proc(n) local S;
       uses StringTools;
      S:= Select(IsAlpha, convert(n, english, And));
      convert(map(`-`, convert(S, bytes), 96), `+`)
    end proc:
    map(f, [$0..200]); # Robert Israel, Jun 11 2021
  • Mathematica
    a[n_] := Total@ Flatten[ ToCharacterCode@# - 96 & /@ Characters@ StringDelete[IntegerName@ n, Except@ LetterCharacter]] (* after Michael De Vlieger in A362065 *); Array[a, 57, 0] (* Robert G. Wilson v, Apr 19 2023 *)
  • PARI
    A073327(n)=sum(i=1,#n=select(t->t>64,Vec(Vecsmall(English(n)))),n[i]%32) \\ see A052360 for English(). - M. F. Hasler, Jun 22 2013
    
  • Python
    import re
    from num2words import num2words
    # US English
    def A073327(n): return sum(ord(d)-96 for d in re.sub(r"\sand\s|[^a-z]", "", num2words(n)))
    # British English
    def A073327(n): return sum(ord(d)-96 for d in re.sub("[^a-z]", "", num2words(n, lang='en_GB'))) # Chai Wah Wu, Jun 13 2021

Extensions

a(0) added by N. J. A. Sloane, Jun 30 2008
More terms from Jon E. Schoenfield, Aug 30 2009

A169639 Write n in French (cf. A167507) and sum the letters using a=1, ..., z=26.

Original entry on oeis.org

64, 35, 54, 81, 82, 43, 52, 60, 58, 46, 37, 60, 71, 83, 123, 92, 64, 97, 95, 83, 72, 132, 126, 153, 154, 115, 124, 132, 130, 118, 82, 142, 136, 163, 164, 125, 134, 142, 140, 128, 97, 157, 151, 178, 179, 140, 149, 157, 155, 143, 104, 164, 158, 185, 186, 147, 156, 164
Offset: 0

Views

Author

Jacques ALARDET, Apr 04 2010

Keywords

Comments

Accents are ignored. - Chai Wah Wu, Jun 11 2021

Examples

			From _Omar E. Pol_, Jun 15 2021: (Start)
-----------------------------------------------------
   n      Name      Calculation                  a(n)
-----------------------------------------------------
   0      Zero      26 +  5 + 18 + 15           = 64
   1      Un        21 + 14                     = 35
   2      Deux       4 +  5 + 21 + 24           = 54
   3      Trois     20 + 18 + 15 +  9 + 19      = 81
   4      Quatre    17 + 21 +  1 + 20 + 18 +  5 = 82
   5      Cinq       3 +  9 + 14 + 17           = 43
   6      Six       19 +  9 + 24                = 52
   7      Sept      19 +  5 + 16 + 20           = 60
   8      Huit       8 + 21 +  9 + 20           = 58
   9      Neuf      14 +  5 + 21 +  6           = 46
  10      Dix        4 +  9 + 24                = 37
  11      Onze      15 + 14 + 26 +  5           = 60
  12      Douze      4 + 15 + 21 + 26 +  5      = 71
... (End)
		

Crossrefs

Cf. A167507, A169641 ("limit points").
For other languages see A073327 (U.S. English), A119945 (German), A161406 (Spanish).

Programs

  • PARI
    A169639(n)=vecsum([t%32|t<-Vecsmall(French(n)),t>64]) \\ Cf. A167507 for French(). - M. F. Hasler, Apr 08 2023
  • Python
    from num2words import num2words
    from unidecode import unidecode
    def A169639(n): return sum(ord(s)-96 for s in unidecode(num2words(n,lang='fr')) if s.isalpha()) # Chai Wah Wu, Jun 11 2021
    

Extensions

Edited by N. J. A. Sloane, Apr 05 2010
Offset corrected by Mohammed Yaseen, Jun 11 2021

A119945 Sum of numerical values of letters in German names of the nonnegative numbers.

Original entry on oeis.org

59, 47, 63, 36, 54, 52, 54, 54, 32, 54, 53, 23, 87, 89, 107, 105, 88, 88, 85, 107, 106, 173, 208, 181, 199, 197, 199, 199, 177, 199, 90, 157, 192, 165, 183, 181, 183, 183, 161, 183, 96, 163, 198, 171, 189, 187, 189, 189, 167, 189, 94, 161, 196, 169, 187, 185, 187, 187, 165
Offset: 0

Views

Author

Wolfdieter Lang, Jul 20 2006

Keywords

Comments

Letters with umlauts are interpreted respectively as "ae" (which does not appear in this entry), "oe", "ue", and "sz" (sharp s) (as in the German name of 30 = "dreißig" -> "dreissig") as "ss" (not "sz").
According to the Reder reference only "zweihundertfuenf", 205 and "zweihundertsieben", 207, satisfy a(n)=n.
This sequence is ambiguous for numbers above 100 because one can use, for instance, for 101 "hundertundeins" or "hunderteins. To avoid such ambiguities one should always stick to the shorter version.
An alternate version of this sequence could ignore umlauts (i.e., take "a" for "ä" etc), or, more in-line with the German alphabet as it is usually listed in textbooks and reference works, taken as ä=27, ö=28, ü=29 (and then maybe ß=30, which could nonetheless remain considered as a ligature of "∫s"="ss"). - M. F. Hasler, Jun 23 2013
It appears that there is no canonical version of this sequence, because of the lack of agreement even on the number of letters in the German alphabet. - N. J. A. Sloane, Jun 11 2021

Examples

			"Null" for 0 in German has numerical values (a=1, b=2, ..., z=26) [14, 21, 12, 12] which sums up to a(0)=59.
The numerical values for "zweihundertfuenf" are [26, 23, 5, 9, 8, 21, 14, 4, 5, 18, 20, 6, 21, 5, 14, 6] with sum 205.
The numerical values for "zweihundertsieben" are [26, 23, 5, 9, 8, 21, 14, 4, 5, 18, 20, 19, 9, 5, 2, 5, 14] with sum 207.
From _Omar E. Pol_, Jun 15 2021: (Start)
-------------------------------------------------------------
   n     Name               Calculation                  a(n)
-------------------------------------------------------------
   0     Null               14 + 21 + 12 + 12           = 59
   1     Eins                5 +  9 + 14 + 19           = 47
   2     Zwei               26 + 23 +  5 +  9           = 63
   3     Drei                4 + 18 +  5 +  9           = 36
   4     Vier               22 +  9 +  5 + 18           = 54
   5     Fünf  --> Fuenf     6 + 21 +  5 + 14 +  6      = 52
   6     Sechs              19 +  5 +  3 +  8 + 19      = 54
   7     Sieben             19 +  9 +  5 +  2 +  5 + 14 = 54
   8     Acht                1 +  3 +  8 + 20           = 32
   9     Neun               14 +  5 + 21 + 14           = 54
  10     Zehn               26 +  5 +  8 + 14           = 53
  11     Elf                 5 + 12 +  6                = 23
  12     Zwölf --> Zwoelf   26 + 23 + 15 +  5 + 12 +  6 = 87
... (End)
a(16) = 88 because "sechzehn" => [19, 5, 3, 8, 26, 5, 8, 14] with sum 88, as for a(17) with "siebzehn" => [19, 9, 5, 2, 26, 5, 8, 14]. - _M. F. Hasler_, Apr 08 2023
		

References

  • Christian Reder, Wörter und Zahlen, Springer Verlag, Komet, Wien, 2000, p. 337.

Crossrefs

For analogs in other languages see A073327 (U.S. English), A169639 (French), A161406 (Spanish).

Programs

  • PARI
    G(n, eins="eins")={my(s(n, p, z, e="ein")=n=divrem(n, p); if(n[2], Str(G(n[1]*p), G(n[2])), Str(G(n[1], e), z))); if(n<20, ["null", eins, "zwei", "drei", "vier", "fuenf", "sechs", "sieben", "acht", "neun", "zehn", "elf", "zwoelf", "dreizehn", "vierzehn", "fuenfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"][n+1], n<100 && n%10, Str(G(n%10, "ein"), "und", G(n\10*10)), n<100, ["zwanzig", "dreissig", "vierzig", "fuenfzig", "sechzig", "siebzig", "achtzig", "neunzig"][n\10-1], n<1000, s(n, 100, "hundert"), n<10^6, s(n, 1000, "tausend"), n<10^9, s(n, 10^6, if(n\10^6>1, " Millionen ", "e Million ")), n<10^12, s(n, 10^9, if(n\10^9>1, " Milliarden ", "e Milliarde ")))}
    \\ extension to Billion, Billiarde, Trillion, Trilliarde, ... is obvious. See A007208 for a variant.
    apply( {A119945(n)=vecsum([t%32|t<-Vecsmall(G(n)),t>64])}, [0..99])
    \\ M. F. Hasler, Apr 08 2023

Extensions

Edited by N. J. A. Sloane, Jun 10 2021
Corrected and extended by M. F. Hasler, Apr 08 2023
Showing 1-4 of 4 results.