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

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

A073029 Names for numbers in American English, with each letter transformed into its index in the alphabet.

Original entry on oeis.org

26, 5, 18, 15, 15, 14, 5, 20, 23, 15, 20, 8, 18, 5, 5, 6, 15, 21, 18, 6, 9, 22, 5, 19, 9, 24, 19, 5, 22, 5, 14, 5, 9, 7, 8, 20, 14, 9, 14, 5, 20, 5, 14, 5, 12, 5, 22, 5, 14, 20, 23, 5, 12, 22, 5, 20, 8, 9, 18, 20, 5, 5, 14, 6, 15, 21, 18, 20, 5, 5, 14, 6, 9, 6, 20, 5, 5, 14, 19, 9, 24, 20, 5
Offset: 0

Views

Author

Zak Seidov, Aug 22 2002

Keywords

Comments

Irregular triangle read by rows, in which row n lists the successive indices of the letters in the American English name for n. For example, row one is 15, 14, 5. - N. J. A. Sloane, Apr 22 2023
Find smallest n's for which a(n)=1,2,3,4,...,26.
A: The numbers 10 and 11 never occur. The rows in which the others occur first (assuming use of the "short scale") are 1000 (thousAnd), 10^9 (Billion), 10^27 (oCtillion), 100 (hunDred), 0 (zEro), 4 (Four), 8 (eiGht), 3 (tHree), 5 (fIve), --, -- (j & k don't occur in English names of numbers), 11 (eLeven), 10^6 (Million), 1 (oNe), 0 (zerO), 10^24 (sePtillion), 10^15 (Quadrillion), 0 (zeRo), 6 (Six), 2 (Two), 4 (foUr), 5 (fiVe), 2 (tWo), 6 (siX), 20 (twentY), 0 (Zero). Converting the position in the row plus the preceding row lengths to a linear index n this yields (after subtracting 1 to match offset 0 of the sequence): 18452, ?, ?, 864, 1, 15, 33, 11, 20, -, -, 44, ?, 5, 3, ?, ?, 2, 23, 7, 17, 21, 8, 25, 115, 0. The graph nicely shows the position & frequency of the individual letters. - M. F. Hasler, Feb 06 2016

Examples

			Top row is for "zero"; "z" is the 26th letter in the alphabet, "e" the fifth, "r" the 18th and "o" the 15th, so the first row is 26,5,18,15.
		

Crossrefs

Cf. A005589 (row lengths).
Cf. A073327 (row sums).
Cf. A072922.

Programs

  • Mathematica
    alef=Characters["abcdefghijklmnopqrstuvwxyz"]; numb="zeroonetwothreefourfivesixseveneightnineteneleven[...]"; ch=Characters[numb]; seq[n_] := Position[alef, ch[[n]]][[1, 1]] (* Franklin T. Adams-Watters, Jun 02 2006 *)
    (* see the link to a001477.txt, copy the first 17 lines and then paste and assign to the variable 'str' as a string as follows *)
    str = "zeroonetwothreefourfivesixseveneightnineteneleventwelvethirteenfourteenfifteensixteen";
    Characters@ str /. Flatten[ Table[ {FromCharacterCode[96 + n] -> n}, {n, 26}]] (* Robert G. Wilson v, Jun 08 2010 *)
  • PARI
    A073029_row(n)=select(t->t>64,Vec(Vecsmall(English(n))))%32 \\ See A052360 for English(). - M. F. Hasler, Feb 06 2016
    
  • Python
    from num2words import num2words
    def row(n): return [ord(c)-96 for c in num2words(n).replace(" and", "") if c.isalpha()]
    print([e for n in range(17) for e in row(n)]) # Michael S. Branicky, Apr 22 2023

Extensions

Corrected and extended by Franklin T. Adams-Watters, Jun 02 2006, Oct 24 2006

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

A073421 Roman numerals for n evaluated as if in base 36.

Original entry on oeis.org

18, 666, 23994, 679, 31, 1134, 40842, 1470330, 681, 33, 1206, 43434, 1563642, 43447, 1219, 43902, 1580490, 56897658, 43449, 1221, 43974, 1583082, 56990970, 1583095, 43987, 1583550, 57007818, 2052281466, 1583097, 43989, 1583622, 57010410, 2052374778, 57010423, 1583635
Offset: 1

Views

Author

Michael Joseph Halm, Aug 23 2002

Keywords

Examples

			a(2) = 666 because 666 is the value of "II" in base 36.
		

References

  • M. J. Halm, Sequences (Re)discovered, Mpossibilities 81 (Aug. 2002).

Crossrefs

Cf. A072922.

Extensions

Missing a(14)-a(19) inserted by Sean A. Irvine, Nov 28 2024

A182380 Primes whose base 26 representation (using a=1, b=2, ..., y=25, z=0) form English words or phrases.

Original entry on oeis.org

31, 53, 61, 67, 109, 149, 157, 197, 223, 313, 347, 353, 359, 379, 409, 421, 503, 509, 521, 613, 691, 743, 859, 863, 929, 1049, 1097, 1163, 1181, 1201, 1249, 1487, 1489, 1601, 2281, 2437, 2441, 2521, 2579, 2741, 2753
Offset: 1

Views

Author

Patrick Devlin, Apr 27 2012

Keywords

Comments

Some particularly pleasing prime words and phrases are (with capitals added merely for visual clarity): [discovered by Patrick Devlin, April 2012]
"somePrime" -> 4092274325963
"somePrimeWordSequence" -> 390521469300124399570501784387
"thisIsAGoodExampleOfAPrimePhrase"
-> 1486423446502142057087542429696717235339605927
And some OEIS-themed prime (pseudo-)words and phrases are:
"NJAS" -> 252869
"integers" -> 76851151747
"welcomeToOEIS" -> 2214931257921335609
"theOEISWordPrime" -> 34075123572372820632427
Let w be any phrase (e.g., w could be Homer's Iliad, or w could be the unabridged concatenation of all of Shakespeare's works). Then Dirichlet's theorem on arithmetic progressions implies that if the last letter of w is relatively prime to 26, then there are infinitely many primes whose final digits base 26 are exactly w. There is no guarantee, however, that these primes would be prime phrases since there is essentially no control over how the beginnings of these base 26 representations would look.

Examples

			The English word "beg" becomes 2*26^2 + 5*26 + 7 = 1489, which is prime, so 1489 is in the sequence.  Similarly, "bee" becomes 1487, which is also prime (thus, "bee" and "beg" are the first 'twin prime words' in this sequence).
		

Crossrefs

Cf. A038842 (base 36 version), A072922.

Programs

  • Maple
    # To test if a word  w="someword" [all lowercase]  corresponds to a prime,
    # call isprime(wordToNumber(w))  or  ifactor(wordToNumber(w))
    letters:=["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]:
    wordToNumber:=proc(w) local lastLetter, i:
        if length(w) = 0 then return 0: end if:
        lastLetter := w[length(w)]:
        for i to nops(letters) - 1 do if letters[i] = lastLetter then return i + 26*wordToNumber(w[1 .. length(w) - 1]): fi: od:
        return 26*wordToNumber(w[1 .. length(w) - 1]):
    end proc:
Showing 1-6 of 6 results.