The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004722 Delete all digits 3 from the terms of the sequence of nonnegative integers. 10

%I #49 Apr 22 2021 22:08:57

%S 0,1,2,4,5,6,7,8,9,10,11,12,1,14,15,16,17,18,19,20,21,22,2,24,25,26,

%T 27,28,29,0,1,2,4,5,6,7,8,9,40,41,42,4,44,45,46,47,48,49,50,51,52,5,

%U 54,55,56,57,58,59,60,61,62,6,64,65,66,67,68,69,70,71,72,7,74,75,76

%N Delete all digits 3 from the terms of the sequence of nonnegative integers.

%C Very similar to A004178, except that 3-repdigits (A002277) are completely removed from the sequence, whereas A004178 has 0's in their place. It is thus guaranteed that a(n) = n only when n < 3. - _Alonso del Arte_, Oct 18 2012

%H Alonso del Arte, <a href="/A004722/b004722.txt">Table of n, a(n) for n = 0..9999</a>

%F a(n) = n for -1 < n < 3;

%F a(n) = A004178(n + 1) for 2 < n < 32,

%F a(n) = A004178(n + 2) for 31 < n < 331,

%F a(n) = A004178(n + 3) for 330 < n < 3330,

%F a(n) = A004178(n + 4) for 3329 < n < 33329, etc. - _Alonso del Arte_, Oct 21 2012

%t endAt = 103; Delete[Table[FromDigits[DeleteCases[IntegerDigits[n], 3]], {n, 0, endAt}], Table[{(10^expo - 1)/3 + 1}, {expo, Floor[Log[10, endAt]]}]] (* _Alonso del Arte_, Apr 29 2019 *)

%o (MATLAB) m=1;

%o for u=0:1000

%o v=dec2base(u,10)-'0'; v = v(v~=3);

%o if length(v)>0;sol(m)=(str2num(strrep(num2str(v), ' ', ''))); m=m+1; end;

%o end

%o sol % _Marius A. Burtea_, May 07 2019

%o (Python)

%o def A004722(n):

%o l = len(str(n))

%o m = (10**l-1)//3

%o k = n + l - int(n+l < m)

%o return 2 if k == m else int(str(k).replace('3','')) # _Chai Wah Wu_, Apr 20 2021

%Y Cf. A004719, A004720, A004721, A004723, A004724, A004725, A004726, A004727, A004728.

%K base,nonn

%O 0,3

%A _N. J. A. Sloane_

%E _Sean A. Irvine_ pointed out erroneous terms in b-file and confirmed correction, Apr 28 2019

%E Name edited by _Felix Fröhlich_, Apr 29 2019

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 8 03:38 EDT 2024. Contains 373207 sequences. (Running on oeis4.)