login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A303475 a(n) is the least m > n, such that every letter, with repetition, that occurs in the English name of n also occurs in the English name of m. 2
14, 21, 13, 14, 25, 16, 17, 18, 19, 13, 111, 112, 37, 74, 57, 67, 77, 78, 79, 21, 120, 122, 122, 124, 125, 126, 127, 128, 125, 31, 125, 128, 132, 134, 135, 136, 137, 138, 135, 41, 124, 124, 124, 144, 145, 64, 74, 148, 94, 51, 145, 152, 152, 154, 155, 156, 157, 158, 155, 61 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Altug Alkan, Table of n, a(n) for n = 1..10000

EXAMPLE

a(2)=21 because 2 is two, and 21 is twenty-one, where all letters of two appear in twenty-one, and this does not happen before 21.

MATHEMATICA

in[n_]:=IntegerName[n, "Words"];

ch[n_]:=Characters[StringReplace[IntegerName[n, "Words"], {"-"->"", " "->""}]];

f[n_]:=Module[{m=n+1}, While[Complement[ch[n], ch[m]]!={}||

Union[Select[Table[Count[ch[m], ch[n][[i]]]-Count[ch[n], ch[n][[i]]], {i, 1, Length[ch[n]]}], #<0&]]!={}, m++]; m];

Array[f, 60] (* Ivan N. Ianakiev, Apr 26 2018 *)

PROG

(PARI)

v1 = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];

v2 = ["eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"];

v3 = ["ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"];

conv(n) = {if (n >= 10^12, error("too big for this program"));

if (n >= 10^9, return (concat(concat(conv(n\10^6), "billion"), conv(n % 10^9))));

if (n >= 10^6, return (concat(concat(conv(n\10^6), "million"), conv(n % 10^6))));

if (n >= 10^3, return (concat(concat(conv(n\10^3), "thousand"), conv(n % 10^3))));

if (n >= 10^2, return (concat(concat(conv(n\100), "hundred"), conv(n % 100))));

if (n >= 20, return (concat(v3[n\10], conv(n%10))); );

if (n >= 10, if (n==10, return(v3[n\10]), return(v2[n % 10])); );

if (n, return(v1[n]), return (""));

}

mycmp(sa, sb) = {my(vsa = Vec(sa), vsb = Vec(sb), vsas = vecsort(vsa, , 8)); for (i=1, #vsas, if (#select(x->x==vsas[i], vsb) < #select(x->x==vsas[i], vsa), return (0)); ); return (1); }

a(n) = {my(m = n+1, sn = conv(n), sm = conv(m)); while(! mycmp(sn, sm), m++; sm = conv(m)); m; }

CROSSREFS

Cf. A303380.

Sequence in context: A129244 A070719 A030643 * A028395 A167170 A213536

Adjacent sequences:  A303472 A303473 A303474 * A303476 A303477 A303478

KEYWORD

nonn,word,look

AUTHOR

Michel Marcus, Apr 24 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 26 20:41 EDT 2019. Contains 321534 sequences. (Running on oeis4.)