OFFSET
1,3
REFERENCES
M. J. Halm, Word Weirdness, Mpossibilities 66 (Feb. 1998), p. 5.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
M. J. Halm, Games
M. F. Hasler, Numbers avoiding certain digits, OEIS Wiki, Jan 12 2020.
FORMULA
If the offset were changed to 0: a(0) = 0, a(n+1) = f(a(n)+1,f(a(n)+1) where f(x,y) = if x<10 and x<>2 then y else if x mod 10 = 2 then f(y+1,y+1) else f(floor(x/10),y). - Reinhard Zumkeller, Mar 02 2008
a(n) = replace digits d > 1 by d + 1 in base-9 representation of n - 1. - Reinhard Zumkeller, Oct 07 2014
Sum_{k>1} 1/a(k) = A082831 = 19.257356... (Kempner series). - Bernard Schott, Jan 12 2020, edited by M. F. Hasler, Jan 14 2020
MAPLE
a:= proc(n) local l, m; l, m:= 0, n-1;
while m>0 do l:= (d->
`if`(d<2, d, d+1))(irem(m, 9, 'm')), l
od; parse(cat(l))/10
end:
seq(a(n), n=1..100); # Alois P. Heinz, Aug 01 2016
MATHEMATICA
ban2Q[n_]:=FreeQ[IntegerDigits[n], 2]==True; Select[Range[0, 89], ban2Q[#] &] (* Jayanta Basu, May 17 2013 *)
Select[Range[0, 100], DigitCount[#, 10, 2]==0&] (* Harvey P. Dale, Apr 13 2015 *)
PROG
(Magma) [ n: n in [0..89] | not 2 in Intseq(n) ]; // Bruno Berselli, May 28 2011
(sh) seq 0 1000 | grep -v 2; # Joerg Arndt, May 29 2011
(Haskell)
a052404 = f . subtract 1 where
f 0 = 0
f v = 10 * f w + if r > 1 then r + 1 else r where (w, r) = divMod v 9
-- Reinhard Zumkeller, Oct 07 2014
(PARI) lista(nn, d=2) = {for (n=0, nn, if (!vecsearch(vecsort(digits(n), , 8), d), print1(n, ", ")); ); } \\ Michel Marcus, Feb 21 2015
(PARI)
apply( {A052404(n)=fromdigits(apply(d->d+(d>1), digits(n-1, 9)))}, [1..99])
next_A052404(n, d=digits(n+=1))={for(i=1, #d, d[i]==2&&return((1+n\d=10^(#d-i))*d)); n} \\ least a(k) > n: if there's a digit 2 in n+1, replace the first occurrence by 3 and all following digits by 0.
select( {is_A052404(n)=!setsearch(Set(digits(n)), 2)}, [0..99])
(Python)
from gmpy2 import digits
def A052404(n): return int(''.join(str(int(d)+1) if d>'1' else d for d in digits(n-1, 9))) # Chai Wah Wu, Aug 30 2024
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Henry Bottomley, Mar 13 2000
EXTENSIONS
Offset changed by Reinhard Zumkeller, Oct 07 2014
STATUS
approved