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 16 results. Next

A007953 Digital sum (i.e., sum of digits) of n; also called digsum(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15
Offset: 0

Views

Author

R. Muller

Keywords

Comments

Do not confuse with the digital root of n, A010888 (first term that differs is a(19)).
Also the fixed point of the morphism 0 -> {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, 1 -> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 2 -> {2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, etc. - Robert G. Wilson v, Jul 27 2006
For n < 100 equal to (floor(n/10) + n mod 10) = A076314(n). - Hieronymus Fischer, Jun 17 2007
It appears that a(n) is the position of 10*n in the ordered set of numbers obtained by inserting/placing one digit anywhere in the digits of n (except a zero before 1st digit). For instance, for n=2, the resulting set is (12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92) where 20 is at position 2, so a(2) = 2. - Michel Marcus, Aug 01 2022
Also the total number of beads required to represent n on a Russian abacus (schoty). - P. Christopher Staecker, Mar 31 2023
a(n) / a(2n) <= 5 with equality iff n is in A169964, while a(n) / a(3n) is unbounded, since if n = (10^k + 2)/3, then a(n) = 3*k+1, a(3n) = 3, so a(n) / a(3n) = k + 1/3 -> oo when k->oo (see Diophante link). - Bernard Schott, Apr 29 2023
Also the number of symbols needed to write number n in Egyptian numerals for n < 10^7. - Wojciech Graj, Jul 10 2025

Examples

			a(123) = 1 + 2 + 3 = 6, a(9875) = 9 + 8 + 7 + 5 = 29.
		

Crossrefs

Programs

  • Haskell
    a007953 n | n < 10 = n
              | otherwise = a007953 n' + r where (n',r) = divMod n 10
    -- Reinhard Zumkeller, Nov 04 2011, Mar 19 2011
    
  • Magma
    [ &+Intseq(n): n in [0..87] ];  // Bruno Berselli, May 26 2011
    
  • Maple
    A007953 := proc(n) add(d,d=convert(n,base,10)) ; end proc: # R. J. Mathar, Mar 17 2011
  • Mathematica
    Table[Sum[DigitCount[n][[i]] * i, {i, 9}], {n, 50}] (* Stefan Steinerberger, Mar 24 2006 *)
    Table[Plus @@ IntegerDigits @ n, {n, 0, 87}] (* or *)
    Nest[Flatten[# /. a_Integer -> Array[a + # &, 10, 0]] &, {0}, 2] (* Robert G. Wilson v, Jul 27 2006 *)
    Total/@IntegerDigits[Range[0,90]] (* Harvey P. Dale, May 10 2016 *)
    DigitSum[Range[0, 100]] (* Requires v. 14 *) (* Paolo Xausa, May 17 2024 *)
  • PARI
    a(n)=if(n<1, 0, if(n%10, a(n-1)+1, a(n/10))) \\ Recursive, very inefficient. A more efficient recursive variant: a(n)=if(n>9, n=divrem(n, 10); n[2]+a(n[1]), n)
    
  • PARI
    a(n, b=10)={my(s=(n=divrem(n, b))[2]); while(n[1]>=b, s+=(n=divrem(n[1], b))[2]); s+n[1]} \\ M. F. Hasler, Mar 22 2011
    
  • PARI
    a(n)=sum(i=1, #n=digits(n), n[i]) \\ Twice as fast. Not so nice but faster:
    
  • PARI
    a(n)=sum(i=1,#n=Vecsmall(Str(n)),n[i])-48*#n \\ M. F. Hasler, May 10 2015
    /* Since PARI 2.7, one can also use: a(n)=vecsum(digits(n)), or better: A007953=sumdigits. [Edited and commented by M. F. Hasler, Nov 09 2018] */
    
  • PARI
    a(n) = sumdigits(n); \\ Altug Alkan, Apr 19 2018
    
  • Python
    def A007953(n):
        return sum(int(d) for d in str(n)) # Chai Wah Wu, Sep 03 2014
    
  • Python
    def a(n): return sum(map(int, str(n))) # Michael S. Branicky, May 22 2021
    
  • Scala
    (0 to 99).map(.toString.map(.toInt - 48).sum) // Alonso del Arte, Sep 15 2019
    
  • Smalltalk
    "Recursive version for general bases. Set base = 10 for this sequence."
    digitalSum: base
    | s |
    base = 1 ifTrue: [^self].
    (s := self // base) > 0
      ifTrue: [^(s digitalSum: base) + self - (s * base)]
      ifFalse: [^self]
    "by Hieronymus Fischer, Mar 24 2014"
    
  • Swift
    A007953(n): String(n).compactMap{$0.wholeNumberValue}.reduce(0, +) // Egor Khmara, Jun 15 2021

Formula

a(A051885(n)) = n.
a(n) <= 9(log_10(n)+1). - Stefan Steinerberger, Mar 24 2006
From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(10n+i) = a(n) + i for 0 <= i <= 9.
a(n) = n - 9*(Sum_{k > 0} floor(n/10^k)) = n - 9*A054899(n). (End)
From Hieronymus Fischer, Jun 17 2007: (Start)
G.f. g(x) = Sum_{k > 0, (x^k - x^(k+10^k) - 9x^(10^k))/(1-x^(10^k))}/(1-x).
a(n) = n - 9*Sum_{10 <= k <= n} Sum_{j|k, j >= 10} floor(log_10(j)) - floor(log_10(j-1)). (End)
From Hieronymus Fischer, Jun 25 2007: (Start)
The g.f. can be expressed in terms of a Lambert series, in that g(x) = (x/(1-x) - 9*L[b(k)](x))/(1-x) where L[b(k)](x) = sum{k >= 0, b(k)*x^k/(1-x^k)} is a Lambert series with b(k) = 1, if k > 1 is a power of 10, else b(k) = 0.
G.f.: g(x) = (Sum_{k > 0} (1 - 9*c(k))*x^k)/(1-x), where c(k) = Sum_{j > 1, j|k} floor(log_10(j)) - floor(log_10(j-1)).
a(n) = n - 9*Sum_{0 < k <= floor(log_10(n))} a(floor(n/10^k))*10^(k-1). (End)
From Hieronymus Fischer, Oct 06 2007: (Start)
a(n) <= 9*(1 + floor(log_10(n))), equality holds for n = 10^m - 1, m > 0.
lim sup (a(n) - 9*log_10(n)) = 0 for n -> oo.
lim inf (a(n+1) - a(n) + 9*log_10(n)) = 1 for n -> oo. (End)
a(n) = A138530(n, 10) for n > 9. - Reinhard Zumkeller, Mar 26 2008
a(A058369(n)) = A004159(A058369(n)); a(A000290(n)) = A004159(n). - Reinhard Zumkeller, Apr 25 2009
a(n) mod 2 = A179081(n). - Reinhard Zumkeller, Jun 28 2010
a(n) <= 9*log_10(n+1). - Vladimir Shevelev, Jun 01 2011
a(n) = a(n-1) + a(n-10) - a(n-11), for n < 100. - Alexander R. Povolotsky, Oct 09 2011
a(n) = Sum_{k >= 0} A031298(n, k). - Philippe Deléham, Oct 21 2011
a(n) = a(n mod b^k) + a(floor(n/b^k)), for all k >= 0. - Hieronymus Fischer, Mar 24 2014
Sum_{n>=1} a(n)/(n*(n+1)) = 10*log(10)/9 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

Extensions

More terms from Hieronymus Fischer, Jun 17 2007
Edited by Michel Marcus, Nov 11 2013

A007088 The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.

Original entry on oeis.org

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, 11111, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 100111
Offset: 0

Views

Author

Keywords

Comments

List of binary numbers. (This comment is to assist people searching for that particular phrase. - N. J. A. Sloane, Apr 08 2016)
Or, numbers that are sums of distinct powers of 10.
Or, numbers having only digits 0 and 1 in their decimal representation.
Complement of A136399; A064770(a(n)) = a(n). - Reinhard Zumkeller, Dec 30 2007
From Rick L. Shepherd, Jun 25 2009: (Start)
Nonnegative integers with no decimal digit > 1.
Thus nonnegative integers n in base 10 such that kn can be calculated by normal addition (i.e., n + n + ... + n, with k n's (but not necessarily k + k + ... + k, with n k's)) or multiplication without requiring any carry operations for 0 <= k <= 9. (End)
For n > 1: A257773(a(n)) = 10, numbers that are Belgian-k for k=0..9. - Reinhard Zumkeller, May 08 2015
For any integer n>=0, find the binary representation and then interpret as decimal representation giving a(n). - Michael Somos, Nov 15 2015
N is in this sequence iff A007953(N) = A101337(N). A028897 is a left inverse. - M. F. Hasler, Nov 18 2019
For n > 0, numbers whose largest decimal digit is 1. - Stefano Spezia, Nov 15 2023

Examples

			a(6)=110 because (1/2)*((1-(-1)^6)*10^0 + (1-(-1)^3)*10^1 + (1-(-1)^1)*10^2) = 10 + 100.
G.f. = x + 10*x^2 + 11*x^3 + 100*x^4 + 101*x^5 + 110*x^6 + 111*x^7 + 1000*x^8 + ...
.
  000    The numbers < 2^n can be regarded as vectors with
  001    a fixed length n if padded with zeros on the left
  010    side. This represents the n-fold Cartesian product
  011    over the set {0, 1}. In the example on the left,
  100    n = 3. (See also the second Python program.)
  101    Binary vectors in this format can also be seen as a
  110    representation of the subsets of a set with n elements.
  111    - _Peter Luschny_, Jan 22 2024
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 21.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §2.8 Binary, Octal, Hexadecimal, p. 64.
  • Manfred R. Schroeder, "Fractals, Chaos, Power Laws", W. H. Freeman, 1991, p. 383.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

The basic sequences concerning the binary expansion of n are this one, A000120 (Hammingweight: sum of bits), A000788 (partial sums of A000120), A000069 (A000120 is odd), A001969 (A000120 is even), A023416 (number of bits 0), A059015 (partial sums). Bisections A099820 and A099821.
Cf. A028897 (convert binary to decimal).

Programs

  • Haskell
    a007088 0 = 0
    a007088 n = 10 * a007088 n' + m where (n',m) = divMod n 2
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Maple
    A007088 := n-> convert(n, binary): seq(A007088(n), n=0..50); # R. J. Mathar, Aug 11 2009
  • Mathematica
    Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 39}]
    Table[Sum[ (Floor[( Mod[f/2 ^n, 2])])*(10^n) , {n, 0, Floor[Log[2, f]]}], {f, 1, 100}] (* José de Jesús Camacho Medina, Jul 24 2014 *)
    FromDigits/@Tuples[{1,0},6]//Sort (* Harvey P. Dale, Aug 10 2017 *)
  • PARI
    {a(n) = subst( Pol( binary(n)), x, 10)}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    {a(n) = if( n<=0, 0, n%2 + 10*a(n\2))}; /* Michael Somos, Jun 07 2002 */
    
  • PARI
    a(n)=fromdigits(binary(n),10) \\ Charles R Greathouse IV, Apr 08 2015
    
  • Python
    def a(n): return int(bin(n)[2:])
    print([a(n) for n in range(40)]) # Michael S. Branicky, Jan 10 2021
    
  • Python
    from itertools import product
    n = 4
    for p in product([0, 1], repeat=n): print(''.join(str(x) for x in p))
    # Peter Luschny, Jan 22 2024

Formula

a(n) = Sum_{i=0..m} d(i)*10^i, where Sum_{i=0..m} d(i)*2^i is the base 2 representation of n.
a(n) = (1/2)*Sum_{i>=0} (1-(-1)^floor(n/2^i))*10^i. - Benoit Cloitre, Nov 20 2001
a(n) = A097256(n)/9.
a(2n) = 10*a(n), a(2n+1) = a(2n)+1.
G.f.: 1/(1-x) * Sum_{k>=0} 10^k * x^(2^k)/(1+x^(2^k)) - for sequence as decimal integers. - Franklin T. Adams-Watters, Jun 16 2006
a(A000290(n)) = A001737(n). - Reinhard Zumkeller, Apr 25 2009
a(n) = Sum_{k>=0} A030308(n,k)*10^k. - Philippe Deléham, Oct 19 2011
For n > 0: A054055(a(n)) = 1. - Reinhard Zumkeller, Apr 25 2012
a(n) = Sum_{k=0..floor(log_2(n))} floor((Mod(n/2^k, 2)))*(10^k). - José de Jesús Camacho Medina, Jul 24 2014

A204093 Numbers whose set of base-10 digits is {0,6}.

Original entry on oeis.org

0, 6, 60, 66, 600, 606, 660, 666, 6000, 6006, 6060, 6066, 6600, 6606, 6660, 6666, 60000, 60006, 60060, 60066, 60600, 60606, 60660, 60666, 66000, 66006, 66060, 66066, 66600, 66606, 66660, 66666, 600000, 600006, 600060, 600066, 600600, 600606, 600660, 600666
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 10 2012

Keywords

Crossrefs

Programs

  • Haskell
    a204093 n = a204093_list !! n
    a204093_list = map (* 6) a007088_list
    
  • Mathematica
    Map[FromDigits,Tuples[{0,6},6]] (* Paolo Xausa, Oct 30 2023 *)
  • Python
    def a(n): return int(bin(n)[2:].replace('1', '6'))
    print([a(n) for n in range(40)]) # Michael S. Branicky, Jun 06 2021

Formula

a(n) = 6 * A007088(n).

A169965 Numbers whose decimal expansion contains only 0's and 2's.

Original entry on oeis.org

0, 2, 20, 22, 200, 202, 220, 222, 2000, 2002, 2020, 2022, 2200, 2202, 2220, 2222, 20000, 20002, 20020, 20022, 20200, 20202, 20220, 20222, 22000, 22002, 22020, 22022, 22200, 22202, 22220, 22222, 200000, 200002, 200020, 200022, 200200, 200202, 200220, 200222
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2010

Keywords

Crossrefs

Programs

  • Haskell
    a169965 n = a169965_list !! (n-1)
    a169965_list = map (* 2) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
  • Mathematica
    Map[FromDigits,Tuples[{0,2},6]] (* Paolo Xausa, Oct 30 2023 *)
  • PARI
    print1(0);for(d=1,5,for(n=2^(d-1),2^d-1,print1(", ");forstep(i=d-1,0,-1,print1((n>>i)%2*2)))) \\ Charles R Greathouse IV, Nov 16 2011
    
  • PARI
    lista(N) = vector(N, i, fromdigits(binary(i-1)*2)); \\ Ruud H.G. van Tol, Oct 26 2024
    

Formula

a(n+1) = Sum_{k>=0} A030308(n,k)*A093136(k+1). - Philippe Deléham, Oct 16 2011
a(n) = 2 * A007088(n-1).

A169967 Numbers whose decimal expansion contains only 0's and 4's.

Original entry on oeis.org

0, 4, 40, 44, 400, 404, 440, 444, 4000, 4004, 4040, 4044, 4400, 4404, 4440, 4444, 40000, 40004, 40040, 40044, 40400, 40404, 40440, 40444, 44000, 44004, 44040, 44044, 44400, 44404, 44440, 44444, 400000, 400004, 400040, 400044, 400400, 400404, 400440, 400444
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2010

Keywords

Crossrefs

Programs

  • Haskell
    a169967 n = a169967_list !! (n-1)
    a169967_list = map (* 4) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
  • Mathematica
    FromDigits/@Tuples[{0,4},6] (* Harvey P. Dale, Dec 21 2018 *)
  • PARI
    print1(0);for(d=1,5,for(n=2^(d-1),2^d-1,print1(", ");forstep(i=d-1,0,-1,print1((n>>i)%2*4)))) \\ Charles R Greathouse IV, Nov 16 2011
    

Formula

a(n+1) = Sum_{k>=0} A030308(n,k)*A093141(k+1). - Philippe Deléham, Oct 16 2011
a(n) = 4 * A007088(n-1).

A169966 Numbers whose decimal expansion contains only 0's and 3's.

Original entry on oeis.org

0, 3, 30, 33, 300, 303, 330, 333, 3000, 3003, 3030, 3033, 3300, 3303, 3330, 3333, 30000, 30003, 30030, 30033, 30300, 30303, 30330, 30333, 33000, 33003, 33030, 33033, 33300, 33303, 33330, 33333, 300000, 300003, 300030, 300033, 300300, 300303, 300330, 300333
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2010

Keywords

Crossrefs

Programs

  • Haskell
    a169966 n = a169966_list !! (n-1)
    a169966_list = map (* 3) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Mathematica
    Map[FromDigits,Tuples[{0,3},6]] (* Paolo Xausa, Oct 30 2023 *)
  • PARI
    print1(0);for(d=1,5,for(n=2^(d-1),2^d-1,print1(", ");forstep(i=d-1,0,-1,print1((n>>i)%2*3)))) \\ Charles R Greathouse IV, Nov 16 2011
    
  • Python
    def a(n): return 3*int(bin(n)[2:])
    print([a(n) for n in range(40)]) # Michael S. Branicky, Mar 30 2021

Formula

a(n+1) = Sum_{k>=0} A030308(n,k)*A093138(k+1). - Philippe Deléham, Oct 16 2011
a(n) = 3 * A007088(n-1).

A204094 Numbers whose set of base 10 digits is {0,7}.

Original entry on oeis.org

0, 7, 70, 77, 700, 707, 770, 777, 7000, 7007, 7070, 7077, 7700, 7707, 7770, 7777, 70000, 70007, 70070, 70077, 70700, 70707, 70770, 70777, 77000, 77007, 77070, 77077, 77700, 77707, 77770, 77777, 700000, 700007, 700070, 700077, 700700, 700707, 700770, 700777
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 10 2012

Keywords

Crossrefs

Programs

  • Haskell
    a204094 n = a204094_list !! n
    a204094_list = map (* 7) a007088_list
  • Mathematica
    FromDigits/@Tuples[{0,7},6] (* Harvey P. Dale, Mar 03 2021 *)

Formula

a(n) = 7 * A007088(n).

A204095 Numbers whose base 10 digits are a subset of {0, 8}.

Original entry on oeis.org

0, 8, 80, 88, 800, 808, 880, 888, 8000, 8008, 8080, 8088, 8800, 8808, 8880, 8888, 80000, 80008, 80080, 80088, 80800, 80808, 80880, 80888, 88000, 88008, 88080, 88088, 88800, 88808, 88880, 88888, 800000, 800008, 800080, 800088, 800800, 800808, 800880, 800888
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 10 2012

Keywords

Crossrefs

Programs

  • Haskell
    a204095 n = a204095_list !! n
    a204095_list = map (* 8) a007088_list
    
  • Maple
    f:= proc(n) local L; L:= convert(n,base,2); add(8*L[i]*10^(i-1),i=1..nops(L)) end proc:
    seq(f(n),n=0..100); # Robert Israel, Jul 28 2014
  • Mathematica
    Table[8 FromDigits[IntegerDigits[n, 2]], {n, 0, 39}] (* Alonso del Arte, Jan 10 2012 *)
  • PARI
    a(n)=8*subst(Pol(binary(n)), x, 10);
    for(n=0, 20, print1(a(n), ", ")) \\ Felix Fröhlich, Jul 26 2014

Formula

a(n) = 8 * A007088(n).

Extensions

Definition corrected by M. F. Hasler, Feb 08 2020

A097256 Numbers whose set of base 10 digits is {0,9}.

Original entry on oeis.org

0, 9, 90, 99, 900, 909, 990, 999, 9000, 9009, 9090, 9099, 9900, 9909, 9990, 9999, 90000, 90009, 90090, 90099, 90900, 90909, 90990, 90999, 99000, 99009, 99090, 99099, 99900, 99909, 99990, 99999, 900000, 900009, 900090, 900099, 900900
Offset: 0

Views

Author

Ray Chandler, Aug 03 2004

Keywords

Comments

n such that there exists a permutation p_1, ..., p_n of 1, ..., n such that i + p_i is a power of 10 for every i.

Crossrefs

Programs

  • Haskell
    a097256 n = a097256_list !! n
    a097256_list = map (* 9) a007088_list
    -- Reinhard Zumkeller, Jan 10 2012
  • Maple
    A097256:=n->(9/2) * add((1-(-1)^floor(n/2^i))*10^i, i=0..n); seq(A097256(n), n=0..30); # Wesley Ivan Hurt, Feb 11 2014
  • Mathematica
    Table[(9/2) Sum[(1 - (-1)^Floor[n/2^i]) 10^i, {i, 0, n}], {n, 0, 30}] (* Wesley Ivan Hurt, Feb 11 2014 *)

Formula

a(n) = 9*A007088(n).
a(2n) = 10*a(n), a(2n+1) = a(2n)+9.

A284379 Numbers k with digits 3 and 5 only.

Original entry on oeis.org

3, 5, 33, 35, 53, 55, 333, 335, 353, 355, 533, 535, 553, 555, 3333, 3335, 3353, 3355, 3533, 3535, 3553, 3555, 5333, 5335, 5353, 5355, 5533, 5535, 5553, 5555, 33333, 33335, 33353, 33355, 33533, 33535, 33553, 33555, 35333, 35335, 35353, 35355, 35533, 35535
Offset: 1

Views

Author

Jaroslav Krizek, Mar 26 2017

Keywords

Comments

Prime terms are in A020462.

Crossrefs

Numbers n with digits 5 and k only for k = 0 - 4 and 6 - 9: A169964 (k = 0), A276037 (k = 1), A072961 (k = 2), this sequence (k = 3), A256290 (k = 4), A256291 (k = 6), A284380 (k = 7), A284381 (k = 8), A284382 (k = 9).

Programs

  • Magma
    [n: n in [1..100000] | Set(IntegerToSequence(n, 10)) subset {3, 5}];
  • Maple
    A:= 3,5: B:= [3,5];
    for i from 1 to 5 do
      B:= map(t -> (10*t+3,10*t+5), B);
      A:= A, op(B);
    od:
    A; # Robert Israel, Apr 13 2020
  • Mathematica
    Select[Range[35600], Times @@ Boole@ Map[MemberQ[{3, 5}, #] &, IntegerDigits@ #] > 0 &] (* or *)
    Table[FromDigits /@ Union@ Apply[Join, Map[Permutations@ # &, Tuples[{3, 5}, n]]], {n, 5}] // Flatten (* Michael De Vlieger, Mar 27 2017 *)

Formula

From Robert Israel, Apr 13 2020: (Start)
a(n) = 2*A007931(n)+A002275(n).
a(2n+1) = 10*a(n)+3.
a(2n+2) = 10*a(n)+5.
G.f. g(x) satisfies g(x) = 10*(x^2+x)*g(x^2) + (3*x+5*x^2)/(1-x^2). (End)
Showing 1-10 of 16 results. Next