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

A158508 Assign weights to the nonnegative integers by multiplying the place value (a = 1, ..., z = 26) of the letters in the US English name (ignoring hyphens and spaces) as in A075831, then sort them by weight. Sort ties by numerical value.

Original entry on oeis.org

1, 10, 6, 5, 2, 9, 4, 0, 8, 3, 7, 50, 11, 40, 80, 60, 15, 12, 90, 30, 20, 18, 16, 19, 70, 51, 13, 14, 56, 55, 17, 52
Offset: 0

Views

Author

Matthew Goers, Nov 03 2009

Keywords

Examples

			Let wt(n) = A075831(n), then wt(1) = 1050 < wt(10) = 1400 < wt(6) = 4104 etc.
		

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

A004740 Integers in alphabetical order in U.S. English.

Original entry on oeis.org

8, 8000000000, 8000000008, 8000000018, 8000000080, 8000000088, 8000000085
Offset: 1

Views

Author

Keywords

Comments

Jasper Mulder, Jan 25 2010, comments that this sequence is ill-defined, since there are an infinite number of cardinal numbers that start with a 'd', namely all those powers of 10 named decillion, duodecillion and so on (see http://en.wikipedia.org/wiki/English_numerals).
However, it would seem then that 'billion' and 'centillion' also precede these, while it is standard (and systematic for this sequence) to refer to such numbers as 'one billion', 'one decillion', etc. - Yasiru Ratnayake, May 03 2012

Examples

			The list begins "eight", "eight billion", "eight billion eight", ... [corrected by _Paul Duckett_, Nov 26 2023]
		

References

  • F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.

Crossrefs

Cf. A019440, A026081. See A108067 for another version.

A226911 Remainder modulo n of the sum of the letters of the English word(s) for n (A073327: a=1, ..., z=26).

Original entry on oeis.org

0, 0, 2, 0, 2, 4, 2, 1, 6, 9, 8, 3, 8, 6, 5, 0, 7, 1, 10, 7, 15, 11, 2, 23, 24, 3, 10, 16, 4, 10, 10, 30, 24, 24, 2, 8, 17, 35, 25, 4, 36, 16, 11, 12, 36, 44, 8, 37, 28, 16, 49, 20, 16, 18, 53, 6, 17, 57, 49, 37, 9, 31, 27, 29, 9, 17, 28, 10, 1, 40, 2, 24, 20, 22, 2, 10, 21, 3
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Jun 22 2013

Keywords

Comments

By definition, a(n) < n so iterated application of this function to any initial value n will create a strictly decreasing sequence ending in 0.

Crossrefs

Programs

  • Maple
    f:= proc(n) local S;
       uses StringTools;
      S:= Select(IsAlpha,convert(n,english));
      convert(map(`-`,convert(S,bytes),96),`+`) mod n
    end proc:
    map(f, [$1..100]); # Robert Israel, Jun 12 2019
  • Mathematica
    a[n_] := Mod[Total@ Flatten[ ToCharacterCode[#] - 96 & /@ Characters@ StringDelete[ IntegerName[n], Except@ LetterCharacter]], n] (* after Michael De Vlieger in A362065 *); Array[a, 78] (* Robert G. Wilson v, Apr 22 2023 *)
  • PARI
    A226911 = n->A073327(n)%n

Formula

a(n) = A073327(n) mod n.
It appears that a(n) = A073327(n) for n > 279. - Robert Israel, Jun 12 2019

A226942 Number of iterations of A226911 until 0 is reached, for starting value n.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jun 23 2013

Keywords

Comments

Iterating the map A226911 was suggested in the SeqFan post by E. Angelini, cf link.

Crossrefs

Programs

  • Maple
    f:= proc(n) local S;
      uses StringTools;
      S:= Select(IsAlpha, convert(n, english));
      convert(map(`-`, convert(S, bytes), 96), `+`) mod n
    end proc:
    g:= proc(n) option remember;
        local v;
        v:= f(n);
        1+procname(v)
    end proc:
    g(0):= 0:
    map(g, [$1..100]); # Robert Israel, Jun 13 2019
  • PARI
    A226942 = n -> for(c=1,9e9,(n=A226911(n))||return(c))
Showing 1-5 of 5 results.