OFFSET
1,2
COMMENTS
a(n) = n for n <= 110; a(111) = 112.
Sequence is finite; last term is 99887766554433221100. There are approximately 10^15 terms in total. - Charles R Greathouse IV, Oct 20 2022
There are < 141709756697784 terms. - Michael S. Branicky, Oct 21 2022
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..91953, all terms <= 10^5
MATHEMATICA
nonDigRepQ[n_] := Max[{Take[Flatten[Tally[IntegerDigits[n]]], {2, -1, 2}]}] < 3; Select[Range[1111], nonDigRepQ[#] &] (* Ivan N. Ianakiev, Sep 25 2015 *)
PROG
(Haskell)
import Data.List (delete)
a262530 n = a262530_list !! (n-1)
a262530_list = filter f [1..] where
f = g d10' . show where
g _ [] = True
g ts (d:ds) = elem d ts && g (delete d ts) ds
d10' = d10 ++ d10; d10 = "0123456789"
(PARI) isok(n) = {my(v = vecsort(digits(n))); my(d = -1); for(i=1, #v, if (v[i] == d, rl++; if (rl > 2, return (0)); , d = v[i]; rl = 1); ); return (1); } \\ Michel Marcus, Sep 29 2015
(PARI) is(n)=my(d=vecsort(digits(n))); for(i=3, #d, if(d[i]==d[i-2], return(0))); 1 \\ Charles R Greathouse IV, Oct 20 2022
(Python)
from math import factorial
from itertools import islice
from sympy.utilities.iterables import multiset_combinations as mc
from sympy.utilities.iterables import multiset_permutations as mp
def agen():
yield from range(1, 100)
for digits in range(3, 21):
for f in "123456789":
r = "".join(sorted([f]+[d*2 for d in "0123456789" if d != f]))
s = set()
for c in mc(r, digits-1):
for p in mp(c):
s.add(int(f + "".join(p)))
yield from sorted(s)
print(list(islice(agen(), 120))) # Michael S. Branicky, Oct 21 2022
CROSSREFS
KEYWORD
nonn,base,fini
AUTHOR
Reinhard Zumkeller, Sep 24 2015
STATUS
approved