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-10 of 824 results. Next

A005589 Number of letters in the US English name of n, excluding 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, 9, 9, 11, 10, 10, 9, 11, 11, 10, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 5, 8, 8, 10, 9, 9, 8, 10, 10, 9, 7, 10, 10, 12, 11, 11, 10, 12, 12, 11, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 6, 9, 9, 11, 10, 10, 9, 11, 11, 10, 10, 13, 13, 15, 14, 14, 13, 15, 15, 14, 13, 16, 16, 18, 18, 17, 17, 19, 18, 18, 16
Offset: 0

Views

Author

Keywords

Comments

Diane Karloff observes (Nov 27 2007) that repeatedly applying the map k->A005589(k) to any starting value n always leads to 4 (cf. A016037, A133418).
The above observation was previously made in 1972 by R. Schroeppel and R. W. Gosper in HAKMEM (Item 134). - Bartlomiej Pawlik, Jun 12 2023
For terms beyond a(100), this sequence uses the US English style, "one hundred one" (not "one hundred and one"), and the short scale (a billion = 10^9, not 10^12). - M. F. Hasler, Nov 03 2013
Explanation of Diane Karloff's observation above: In many languages there exists a number N, after which all numbers are written with fewer letters than the number itself. N is 4 in English, German and Bulgarian, and 11 in Russian. If in the interval [1,N] there are numbers equal to the number of their letters, then they are attractors. In English and German the only attractor is 4, in Bulgarian 3, in Russian there are two, 3 and 11. In the interval [1,N] there may also exist loops of numbers, for instance 4 and 6 in Bulgarian (6 and 4 letters respectively) or 4,5 and 6 in Russian (6,4 and 5 letters respectively). There are no loops in English, therefore the above observation is true. - Ivan N. Ianakiev, Sep 20 2014

Examples

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

References

  • Problems Drive, Eureka, 37 (1974), 8-11 and 33.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A362123 for another version.
Cf. A007208 (analog for German).

Programs

  • Mathematica
    inWords[n_] := Module[{r,
    numNames = {"", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"},
    teenNames = {"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"},
    tensNames = {"", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"},
    decimals = {"", "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "quattuordecillion", "quindecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vigintillion", "unvigintillion", "duovigintillion", "trevigintillion", "quattuorvigintillion", "quinvigintillion", "sexvigintillion", "septenvigintillion", "octovigintillion", "novemvigintillion", "trigintillion", "untrigintillion", "duotrigintillion"}},
    r = If[# != 0, numNames[[# + 1]] <> "hundred"
    (* <> If[#2 != 0||#3 != 0," and",""] *),
    ""] <> Switch[#2, 0, numNames[[#3 + 1]], 1, teenNames[[#3 + 1]], _, tensNames[[#2 + 1]] <> numNames[[#3 + 1]]] & @@@
    (PadLeft[ FromDigits /@ Characters@ StringReverse@#, 3] & /@ StringCases[ StringReverse@ IntegerString@ n, RegularExpression["\\d{1,3}"]]);
    StringJoin@ Reverse@ MapThread[ If[# != "", StringJoin[##], ""] &, {r, Take[decimals, Length@ r]} ]]; (* modified for this sequence from what is presented in the link and good to 10^102 -1 *)
    f[n_] := StringLength@ inWords@ n; f[0] = 4; Array[f, 84, 0]
    (* Robert G. Wilson v, Nov 04 2007 and revised Mar 31 2015, small revision by Ivan Panchenko, Nov 10 2019 *)
    a[n_] := StringLength[ StringReplace[ IntegerName[n, "Words"], "," | " " | "\[Hyphen]" -> ""]]; a /@ Range[0, 83] (* Mma version >= 10, Giovanni Resta, Apr 10 2017 *)
  • PARI
    A005589(n, t=[10^12, #"trillion", 10^9, #"billion", 10^6, #"million", 1000, #"thousand", 100, #"hundred"])={ n>99 && forstep( i=1, #t, 2, n999 && error("n >= 10^",valuation(t[1],10)+3," requires extended 2nd argument"); return( A005589(n[1])+t[i+1]+if( n[2], A005589( 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]), #([ "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ][n\10-1])+if( n%10, A005589(n%10)))}  \\ Extension of 2nd arg to larger numbers is easy using the names listed in Mathematica section above. Only the string lengths are required, so it's easy to extend this list further without additional knowledge and without writing out the names. - M. F. Hasler, Jul 26 2011, minor edit on Jun 15 2021
    
  • Python
    from num2words import num2words
    def a(n):
        x = num2words(n).replace(' and ', '')
        l = [chr(i) for i in range(97, 123)]
        return sum(1 for i in x if i in l)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jul 05 2017

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Allan C. Wechsler, Mar 20 2000
Erroneous b-file deleted by N. J. A. Sloane, Sep 25 2008
More than the usual number of terms are shown in the DATA field to avoid confusion with A362123. - N. J. A. Sloane, Apr 20 2023

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

A005224 T is the first, fourth, eleventh, ... letter in this sentence, not counting spaces or commas (Aronson's sequence).

Original entry on oeis.org

1, 4, 11, 16, 24, 29, 33, 35, 39, 45, 47, 51, 56, 58, 62, 64, 69, 73, 78, 80, 84, 89, 94, 99, 104, 111, 116, 122, 126, 131, 136, 142, 147, 158, 164, 169, 174, 181, 183, 193, 199, 205, 208, 214, 220, 226, 231, 237, 243, 249, 254, 270, 288, 303, 307, 319, 323, 341
Offset: 1

Views

Author

Keywords

Comments

a(10^9) = 11281384554. - Hans Havermann, Apr 21 2017
First differences start: 3, 7, 5, 8, 5, 4, 2, 4, 6, 2, 4, 5, 2, 4, 2, 5, 4, 5, 2, 4, 5, 5, 5, 5, 7, 5, 6, 4, 5, 5, 6, 5, 11, 6, 5, 5, 7, 2, 10, 6, ... - Daniel Forgues, Sep 11 2019
Named after the British clinical pharmacologist Jeffrey Kenneth Aronson (b. 1947). - Amiram Eldar, Jun 23 2021

Examples

			The sentence begins
1234567890 1234567890 1234567890 1234567890 1234567890
Tisthefirs tfourthele venthsixte enthtwenty fourthtwen
tyninththi rtythirdth irtyfiftht hirtyninth fortyfifth
fortyseven thfiftyfir stfiftysix thfiftyeig hthsixtyse
condsixtyf ourthsixty ninthseven tythirdsev entyeighth
eightiethe ightyfourt heightynin thninetyfo urthninety
ninthonehu ndredfourt honehundre deleventho nehundreds
ixteenthon ehundredtw entysecond onehundred twentysixt
honehundre dthirtyfir stonehundr edthirtysi xthonehund
redfortyse cond...
		

References

  • J. K. Aronson, quoted by D. R. Hofstadter in Metamagical Themas, Basic Books, NY, 1985, p. 44.
  • James Gleick, Faster, Vintage Books, NY, 2000 (see pp. 259-261).
  • N. J. A. Sloane, Seven Staggering Sequences, in Homage to a Pied Puzzler, E. Pegg Jr., A. H. Schoen and T. Rodgers (editors), A. K. Peters, Wellesley, MA, 2009, pp. 93-110.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    seed="tisthe"; s[1]=1;s[2]=4;
    name[n_]:=StringReplace[IntegerName[n,{"English","Ordinal"}],{"-"->""," "->""}];
    s[n_]:=seed=StringJoin[seed<>name[StringPosition[seed,"t"][[n-2,1]]]];
    l=s/@Range[58]; Table[StringPosition[Last[l],"t"][[i,1]],{i,1,Length[l]}] (* Ivan N. Ianakiev, Mar 25 2020 *)
  • Python
    from num2words import num2words
    from itertools import islice
    def n2w(n):
        os = num2words(n, ordinal=True).replace(" and", "")
        return os.replace(" ", "").replace("-", "").replace(chr(44), "")
    def agen(): # generator of terms
        s, idx = "tisthe", 0
        while True:
            idx_rel = 1 + s.index("t")
            idx += idx_rel
            yield idx
            s = s[idx_rel:] + n2w(idx)
    print(list(islice(agen(), 58))) # Michael S. Branicky, Mar 18 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Oct 31 2000

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

A000052 1-digit numbers arranged in alphabetical order, then the 2-digit numbers arranged in alphabetical order, then the 3-digit numbers, etc.

Original entry on oeis.org

8, 5, 4, 9, 1, 7, 6, 3, 2, 0, 18, 80, 88, 85, 84, 89, 81, 87, 86, 83, 82, 11, 15, 50, 58, 55, 54, 59, 51, 57, 56, 53, 52, 40, 48, 45, 44, 49, 41, 47, 46, 43, 42, 14, 19, 90, 98, 95, 94, 99, 91, 97, 96, 93, 92, 17, 70, 78, 75, 74, 79, 71, 77, 76, 73, 72
Offset: 1

Views

Author

Keywords

Comments

This sequence uses standard US English names for numbers. - Daniel Forgues, May 11 2016
For example, standard US English writes out the number 101 as "one hundred one", whereas standard UK English writes it out as "one hundred and one" (see Links). - Jon E. Schoenfield, Dec 25 2016
Alphabetical order is with spaces removed/disregarded, else, as a first example, a(1003)=8018 ("eight thousand eighteen") would follow a(1004)=8800 ("eight thousand eight hundred") among others. - Michael S. Branicky, Aug 05 2021

Examples

			eight, five, four, nine, one, seven, six, three, two, zero, eighteen, etc.
Examples of spelling convention used for values above 99:
400: "four hundred"
726: "seven hundred twenty-six"
1992: "one thousand nine hundred ninety-two"
2202: "two thousand two hundred two"
101001: "one hundred one thousand one"
726726: "seven hundred twenty-six thousand seven hundred twenty-six"
101000001: "one hundred one million one"
		

Crossrefs

Cf. A001058.

Programs

  • Maple
    V:= [[$0..9],[$10..99],[$100..999]]:
    seq(op(V[i][sort(map(convert,V[i],english,'And'),
    output=permutation)]),i=1..3); # Robert Israel, Jun 17 2016
  • Mathematica
    Flatten@Join[{8, 5, 4, 9, 1, 7, 6, 3, 2, 0}, SortBy[Range[10^#, 10^(# + 1) - 1], StringReplace[IntegerName[#, "Words"], "," -> ""] &] & /@ Range[3]] (* Davin Park, Dec 25 2016 *)
  • Python
    from num2words import num2words
    def n2w(n):
      return num2words(n).replace(" and", "").replace(",", "").replace(" ", "")
    def agen(maxdigits):
      for d in range(1, maxdigits+1):
        yield from sorted(range(10**(d-1)-(d==1), 10**d), key=lambda x: n2w(x))
    print([an for an in agen(2)]) # Michael S. Branicky, Aug 05 2021

Extensions

Corrected by Davin Park, Dec 25 2016

A006933 'Eban' numbers (the letter 'e' is banned!).

Original entry on oeis.org

2, 4, 6, 30, 32, 34, 36, 40, 42, 44, 46, 50, 52, 54, 56, 60, 62, 64, 66, 2000, 2002, 2004, 2006, 2030, 2032, 2034, 2036, 2040, 2042, 2044, 2046, 2050, 2052, 2054, 2056, 2060, 2062, 2064, 2066, 4000, 4002, 4004, 4006, 4030, 4032, 4034, 4036, 4040, 4042, 4044, 4046, 4050, 4052, 4054, 4056, 4060, 4062, 4064, 4066, 6000
Offset: 1

Views

Author

Keywords

Comments

Invented by N. J. A. Sloane circa 1990.
Theorem (N. J. A. Sloane): in English every odd number contains an 'e'.
The first number that would appear in the British Eban list but not the American list is 2*10^21. - Douglas Boffey, Jun 21 2012
A085513(a(n)) = 0. - Reinhard Zumkeller, Jan 23 2015

Examples

			2052 is in the sequence because written out in English words, "two thousand fifty-two", it does not contain a single instance of the letter E.
2053 (two thousand fifty-three) is not in the sequence because written out it contains two instances of E.
		

References

  • J. C. Hernandez et al., "Characterization of Eban numbers", pp. 197-200, Journal of Recreational Mathematics, 31 (3) 2002-2003.
  • Georges Perec, La disparition, Editions Gallimard, Paris, 1969; English translation: A Void, Harvill, 1994. (A novel that does not use the letter "e".)
  • Georges Perec, Les Revenentes [a novel in which the only vowel that appears is 'e']. - From Simon Plouffe, Mar 12 2010
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A082504.
Cf. A085513, A008520 (complement), A008521 (ban o), A008523 (ban t), A089589 (ban i), A089590 (ban u), A014254 (a French version), A287876 (a Hebrew version).
Cf. A008537 (without 'n'), A072956 (turban numbers: without r, t or u), A072957 (urban numbers: without r or u), A089589 (without 'i').

Programs

  • Haskell
    import Data.Maybe (fromJust)
    import Data.Text (Text); import qualified Data.Text as T (unpack)
    import Text.Numeral.Grammar.Reified (defaultInflection)
    import qualified Text.Numeral.Language.EN as EN  -- see link
    a006933 n = a006933_list !! (n-1)
    a006933_list = filter (T.all (/= 'e') . numeral) [0..] where
       numeral :: Integer -> Text
       numeral = fromJust . EN.gb_cardinal defaultInflection
    -- Reinhard Zumkeller, Jan 23 2015
    
  • Magma
    [ n : n in [1..100] | forall{ i : i in [1..#seq] | seq[i] in eban[(i-1)mod 3+1]} where seq is Intseq(n) ] where eban is [[0,2,4,6],[0,3,4,5,6],[0]]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
    
  • PARI
    is(n)=!setsearch(Set(Vec(English(n))), "e") \\ See A052360 for English(). - M. F. Hasler, Apr 01 2019
  • Python
    from num2words import num2words
    [n for n in range(6001) if 'e' not in num2words(n)] # Indranil Ghosh, Jul 05 2017
    

Extensions

More terms from WG Zeist, Aug 28 2012
More cross-references from M. F. Hasler, Apr 01 2019

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

A247751 Numbers in decimal representation, such that in Danish their digits are in alphabetic order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 33, 40, 42, 43, 44, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 66, 67, 72, 73, 77, 82, 83, 86, 87, 88, 90, 92, 93, 96, 97, 98, 99, 100, 102, 103, 106, 107, 108
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 05 2014

Keywords

Comments

List of decimal digits, alphabetically sorted by their names in Danish:
1 en/et, 5 fem, 4 fire, 9 ni, 0 nul, 8 otte, 6 seks, 7 syv, 2 to, 3 tre;
a(124929) = A247801(992) = 1549086723 is the greatest term not containing any repeating digits.

Crossrefs

Cf. A247801 (subsequence).
Cf. A247750 (Czech), A247752 (Dutch), A053432 (English), A247753 (Finnish), A247754 (French), A247755 (German), A247756 (Hungarian), A247757 (Italian), A247758 (Latin), A247759 (Norwegian), A247760 (Polish), A247757 (Portuguese), A247761 (Russian), A247762 (Slovak), A161390 (Spanish), A247759 (Swedish), A247764 (Turkish).

Programs

  • Haskell
    import Data.IntSet (fromList, deleteFindMin, union)
    a247751 n = a247751_list !! (n-1)
    a247751_list = 0 : f (fromList [1..9]) where
       f s = x : f (s' `union`
             fromList (map (+ 10 * x) $ dropWhile (/= mod x 10) digs))
         where (x, s') = deleteFindMin s
       digs = [1, 5, 4, 9, 0, 8, 6, 7, 2, 3]

A053432 Numbers with digits in alphabetical order (in English).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 20, 22, 30, 32, 33, 40, 41, 42, 43, 44, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 62, 63, 66, 70, 72, 73, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97, 99, 100
Offset: 1

Views

Author

G. L. Honaker, Jr., Jan 10 2000

Keywords

Comments

a(142447) = A053433(1023) = 8549176320 is the greatest term not containing any repeating digits. - Reinhard Zumkeller, Oct 05 2014

Crossrefs

Cf. A247750 (Czech), A247751 (Danish), A247752 (Dutch), A247753 (Finnish), A247754 (French), A247755 (German), A247756 (Hungarian), A247757 (Italian), A247758 (Latin), A247759 (Norwegian), A247760 (Polish), A247757 (Portuguese), A247761 (Russian), A247762 (Slovak), A161390 (Spanish), A247759 (Swedish), A247764 (Turkish).

Programs

  • Haskell
    import Data.IntSet (fromList, deleteFindMin, union)
    a053432 n = a053432_list !! (n-1)
    a053432_list = 0 : f (fromList [1..9]) where
       f s = x : f (s' `union`
             fromList (map (+ 10 * x) $ dropWhile (/= mod x 10) digs))
         where (x, s') = deleteFindMin s
       digs = [8, 5, 4, 9, 1, 7, 6, 3, 2, 0]
    -- Reinhard Zumkeller, Oct 05 2014.
    
  • Python
    from itertools import count, islice, combinations_with_replacement as cwr
    def agen(): # generator of terms
        for d in count(1):
            out = sorted(int("".join(t)) for t in cwr("8549176320", d))
            yield from out[1-int(d==1):] # remove extra 0's
    print(list(islice(agen(), 65))) # Michael S. Branicky, Aug 17 2022

A053433 Numbers with distinct digits in alphabetical order (in English).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 16, 17, 20, 30, 32, 40, 41, 42, 43, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 59, 60, 62, 63, 70, 72, 73, 76, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 96, 97, 120, 130, 132, 160, 162, 163, 170, 172, 173, 176
Offset: 1

Views

Author

G. L. Honaker, Jr., Jan 10 2000

Keywords

Comments

Largest term is 8549176320.

Crossrefs

Subsequence of A053432.
Cf. A247800 (Czech), A247801 (Danish), A247802 (Dutch), A247803 (Finnish), A247804 (French), A247805 (German), A247806 (Hungarian), A247807 (Italian), A247808 (Latin), A247809 (Norwegian), A247810 (Polish), A247807 (Portuguese), A247811 (Russian), A247812 (Slovak), A247813 (Spanish), A247809 (Swedish), A247814 (Turkish).

Programs

  • Haskell
    import Data.IntSet (fromList, deleteFindMin, union)
    import qualified Data.IntSet as Set (null)
    a053433 n = a053433_list !! (n-1)
    a053433_list = 0 : f (fromList [1..9]) where
       f s | Set.null s = []
           | otherwise  = x : f (s' `union`
             fromList (map (+ 10 * x) $ tail $ dropWhile (/= mod x 10) digs))
           where (x, s') = deleteFindMin s
       digs = [8, 5, 4, 9, 1, 7, 6, 3, 2, 0]
    -- Reinhard Zumkeller, Oct 05 2014
    
  • Python
    from itertools import combinations
    afull = sorted(int("".join(t)) for d in range(1, 11) for t in combinations("8549176320", d))
    print(afull[:65]) # Michael S. Branicky, Aug 17 2022
Showing 1-10 of 824 results. Next