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.

A120742 First differences of A073029.

Original entry on oeis.org

-21, 13, -3, 0, -1, -9, 15, 3, -8, 5, -12, 10, -13, 0, 1, 9, 6, -3, -12, 3, 13, -17, 14, -10, 15, -5, -14, 17, -17, 9, -9, 4, -2, 1, 12, -6, -5, 5, -9, 15, -15, 9, -9, 7, -7, 17, -17, 9, 6, 3, -18, 7, 10, -17, 15, -12, 1, 9, 2, -15, 0, 9, -8, 9, 6, -3, 2, -15, 0, 9, -8, 3, -3, 14, -15, 0, 9, 5, -10, 15, -4, -15
Offset: 0

Views

Author

N. J. A. Sloane, Sep 21 2007

Keywords

Comments

Suggested by A131744.

A131744 Eric Angelini's "1995" puzzle: the sequence is defined by the property that if one writes the English names for the entries, replaces each letter with its rank in the alphabet and calculates the absolute values of the differences, one recovers the sequence.

Original entry on oeis.org

1, 9, 9, 5, 5, 9, 9, 5, 5, 9, 1, 3, 13, 17, 1, 3, 13, 17, 9, 5, 5, 9, 9, 5, 5, 9, 1, 3, 13, 17, 1, 3, 13, 17, 9, 5, 5, 9, 10, 1, 9, 15, 12, 10, 13, 0, 15, 12, 1, 9, 2, 15, 0, 9, 5, 14, 17, 17, 9, 6, 15, 0, 9, 1, 1, 9, 15, 12, 10, 13, 0, 15, 12, 1, 9, 2, 15, 0, 9, 5, 14, 17, 17, 9
Offset: 1

Views

Author

Eric Angelini, Sep 20 2007

Keywords

Comments

In the first few million terms, the numbers 16, 19, 20 and 22-26 do not occur. Of the numbers that do occur, the number 11 appears with the smallest frequence - see A133152. - N. J. A. Sloane, Sep 22 2007
From David Applegate, Sep 24 2007: (Start)
The numbers 16, 19-20, 22-25 never occur in the sequence. The following table gives the possible numbers that can occur in the sequence and for each one, the possible numbers that can follow it. The table is complete - when any number and its successor are expanded, the resulting pairs are also in the table. It contains the expansion of 1 and thus describes all possible transitions:
0 -> 0,1,4,5,7,9,10,12,15,21
1 -> 1,3,5,9,12
2 -> 1,3,12,15
3 -> 0,1,2,3,4,5,8,9,11,12,13,14,18
4 -> 2,3,12,14
5 -> 3,5,9,10,12,14,15
6 -> 3,5,12,15,21
7 -> 7,10,17
8 -> 0,3,5,9
9 -> 0,1,2,3,4,5,6,8,9,10,12,14,15,21
10 -> 1,13,15,17
11 -> 21
12 -> 0,1,6,9,10,14,15,21
13 -> 0,3,17
14 -> 3,10,15,17
15 -> 0,3,4,9,12,15,18
17 -> 1,9,10,14,15,17,21
18 -> 3,7,9
21 -> 13,21
(End)
The sequence may also be extended in the reverse direction: ... 0 21 21 13 3 0 [then what we have now] 1 9 9 5 5 ..., corresponding to ... zero twentyone twentyone thirteen three zero one nine nine five ... - N. J. A. Sloane, Sep 27 2007
The name of this sequence ("Eric Angelini's ... puzzle") was added by N. J. A. Sloane many months after Eric Angelini submitted it.
Begin with 1, map the integer to its name and then map according to A073029, compute the absolute difference, spell out that difference; iterate as necessary. - Robert G. Wilson v, Jun 08 2010

Examples

			O.N.E...N.I.N.E...N.I.N.E...F.I..V..E...F.I..V..E...
.1.9..9..5.5.9..9..5.5.9..1..3.13.17..1..3.13.17....
1 -> "one" -> 15,14,5 -> (the difference is) 1,9; iterate. Therefore 1,9 -> "one,nine"; -> 15,14,5,14,9,14,5 -> 1,9,9,5,5,9; "one,nine,nine,five,five,nine"; etc. - _Robert G. Wilson v_, Jun 08 2010
		

Crossrefs

Cf. A131285 (ranks of letters), A131286, A131287.

Programs

  • Mathematica
    Nest[Abs@Differences@Flatten[LetterNumber[Characters[IntegerName@#]/."-"->""]&/@#]&,{1},4] (* Giorgos Kalogeropoulos, Apr 11 2021 *)
  • Python
    def chrdist(a, b): return abs(ord(a)-ord(b))
    def aupto(nn):
      allnames = "zero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty,twentyone"
      names = allnames.split(",")
      alst, aidx, last, nxt = [1, 9], 1, "e", "one"
      while len(alst) < nn:
        nxt = names[alst[aidx]]
        alst += [chrdist(a, b) for a, b in zip(last+nxt[:-1], nxt)]
        last, aidx = nxt[-1], aidx + 1
      return alst[:nn]
    print(aupto(84)) # Michael S. Branicky, Jan 09 2021

Extensions

More terms from N. J. A. Sloane, Sep 20 2007

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

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

A268490 Spelling out the characters (digits and commas) of the sequence and replacing letters A..Z with numbers 1..26 gives back the sequence.

Original entry on oeis.org

20, 23, 15, 26, 5, 18, 15, 3, 15, 13, 13, 1, 20, 23, 15, 20, 8, 18, 5, 5, 3, 15, 13, 13, 1, 15, 14, 5, 6, 9, 22, 5, 3, 15, 13, 13, 1, 20, 23, 15, 19, 9, 24, 3, 15, 13, 13, 1, 6, 9, 22, 5, 3, 15, 13, 13, 1, 15, 14, 5, 5, 9, 7, 8, 20, 3, 15, 13, 13, 1, 15, 14, 5, 6, 9, 22, 5, 3, 15, 13, 13, 1, 20, 8, 18, 5, 5, 3, 15, 13, 13, 1, 15, 14, 5, 6, 9, 22, 5, 3, 15, 13, 13, 1, 15, 14, 5, 20, 8
Offset: 1

Views

Author

M. F. Hasler, Feb 06 2016

Keywords

Comments

A sequence with this property cannot start otherwise since 2 is the only digit equal to the first digit of the "code" (1-26) of the first letter of its English name.

Examples

			Spelling out the sequence data character-wise yields "two zero comma two three comma one five ..."
Coding the letters A..Z by 1..26 yields again the sequence 20, 23, 15, 26, 5, 18, 15, 3, 15, 13, 13, ...
		

Crossrefs

Programs

  • PARI
    concat(apply(f=t->Vec(Vecsmall(concat(concat(apply(English,digits(t))),"comma")))%32,f(20))) \\ See A052360 for English()

A362443 Numbers k with property that the set of letters in the English name for k does not contain two letters that are adjacent in the alphabet.

Original entry on oeis.org

0, 2, 3, 4, 6, 7, 9, 10, 11, 19, 20, 23, 29, 40, 42, 50, 52, 90, 99
Offset: 1

Views

Author

N. J. A. Sloane, Apr 22 2023

Keywords

Comments

In other words, k such that row k of the triangle A073029, when converted to a set, does not contain two consecutive numbers.
Since hundred, thousand, million, all contain two consecutive letters, there are no other terms.

Examples

			3 is a term because the set {20, 8, 18, 5} (from t,h,r,e,e) does not contain two consecutive numbers.
But 5 is not a term, since e and f are adjacent in the alphabet.
		

References

  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See pages 99 and 286.

Crossrefs

Cf. A073029.

Programs

  • Python
    from num2words import num2words as n2w
    def ok(n):
        w = sorted(c for c in set(n2w(n).replace(" and", "")) if c.isalpha())
        return min(ord(w[i+1])-ord(w[i]) for i in range(len(w)-1)) > 1
    print([k for k in range(100) if ok(k)]) # Michael S. Branicky, Apr 22 2023

Extensions

Terms 0 and 50 inserted by Michael S. Branicky, Apr 22 2023
Showing 1-7 of 7 results.