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

A007931 Numbers that contain only 1's and 2's. Nonempty binary strings of length n in lexicographic order.

Original entry on oeis.org

1, 2, 11, 12, 21, 22, 111, 112, 121, 122, 211, 212, 221, 222, 1111, 1112, 1121, 1122, 1211, 1212, 1221, 1222, 2111, 2112, 2121, 2122, 2211, 2212, 2221, 2222, 11111, 11112, 11121, 11122, 11211, 11212, 11221, 11222, 12111, 12112, 12121, 12122
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Numbers written in the dyadic system [Smullyan, Stillwell]. - N. J. A. Sloane, Feb 13 2019
Logic-binary sequence: prefix it by the empty word to have all binary words on the alphabet {1,2}.
The least binary word of length k is a(2^k - 1).
See Mathematica program for logic-binary sequence using (0,1) in place of (1,2); the sequence starts with 0,1,00,01,10. - Clark Kimberling, Feb 09 2012
A007953(a(n)) = A014701(n+1); A007954(a(n)) = A048896(n). - Reinhard Zumkeller, Oct 26 2012
a(n) is n written in base 2 where zeros are not allowed but twos are. The two distinct digits used are 1, 2 instead of 0, 1. To obtain this sequence from the "canonical" base 2 sequence with zeros allowed, just replace any 0 with a 2 and then subtract one from the group of digits situated on the left: (10-->2; 100-->12; 110-->22; 1000-->112; 1010-->122). - Robin Garcia, Jan 31 2014
For numbers made of only two different digits, see also A007088 (digits 0 & 1), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340(digits 7 & 8), A256341 (digits 8 & 9), and A032804-A032816 (in other bases). Numbers with exactly two distinct (but unspecified) digits in base 10 are listed in A031955, for other bases in A031948-A031954. - M. F. Hasler, Apr 04 2015
The variant with digits {0, 1} instead of {1, 2} is obtained by deleting all initial digits in sequence A007088 (numbers written in base 2). - M. F. Hasler, Nov 03 2020

Examples

			Positive numbers may not start with 0 in the OEIS, otherwise this sequence would have been written as: 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111, 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 00000, 00001, 00010, 00011, 00100, 00101, 00110, 00111, 01000, 01001, 01010, 01011, ...
From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(10)   = 122.
a(100)  = 211212.
a(10^3) = 222212112.
a(10^4) = 1122211121112.
a(10^5) = 2111122121211112.
a(10^6) = 2221211112112111112.
a(10^7) = 11221112112122121111112.
a(10^8) = 12222212122221111211111112.
a(10^9) = 22122211221212211212111111112. (End)
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 2. - From N. J. A. Sloane, Jul 26 2012
  • K. Atanassov, On the 97th, 98th and the 99th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 3, 89-93.
  • R. M. Smullyan, Theory of Formal Systems, Princeton, 1961.
  • John Stillwell, Reverse Mathematics, Princeton, 2018. See p. 90.

Crossrefs

Cf. A007932 (digits 1-3), A059893, A045670, A052382 (digits 1-9), A059939, A059941, A059943, A032924, A084544, A084545, A046034 (prime digits 2,3,5,7), A089581, A084984 (no prime digits); A001742, A001743, A001744: loops; A202267 (digits 0, 1 and primes), A202268 (digits 1,4,6,8,9), A014261 (odd digits), A014263 (even digits).
Cf. A007088 (digits 0 & 1), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9), and A032804-A032816 (in other bases).
Cf. A020450 (primes).

Programs

  • Haskell
    a007931 n = f (n + 1) where
       f x = if x < 2 then 0 else (10 * f x') + m + 1
         where (x', m) = divMod x 2
    -- Reinhard Zumkeller, Oct 26 2012
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {1,2}]; // Vincenzo Librandi, Aug 19 2016
    
  • Maple
    # Maple program to produce the sequence:
    a:= proc(n) local m, r, d; m, r:= n, 0;
          while m>0 do d:= irem(m, 2, 'm');
            if d=0 then d:=2; m:= m-1 fi;
            r:= d, r
          od; parse(cat(r))/10
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 26 2016
    # Maple program to invert this sequence: given a(n), it returns n. - N. J. A. Sloane, Jul 09 2012
    invert7931:=proc(u)
    local t1,t2,i;
    t1:=convert(u,base,10);
    [seq(t1[i]-1,i=1..nops(t1))];
    [op(%),1];
    t2:=convert(%,base,2,10);
    add(t2[i]*10^(i-1),i=1..nops(t2))-1;
    end;
  • Mathematica
    f[n_] := FromDigits[Rest@IntegerDigits[n + 1, 2] + 1]; Array[f, 42] (* Robert G. Wilson v Sep 14 2006 *)
    (* Next, A007931 using (0,1) instead of (1,2) *)
    d[n_] := FromDigits[Rest@IntegerDigits[n + 1, 2] + 1]; Array[FromCharacterCode[ToCharacterCode[ToString[d[#]]] - 1] &, 100] (* Peter J. C. Moses, at request of Clark Kimberling, Feb 09 2012 *)
    Flatten[Table[FromDigits/@Tuples[{1,2},n],{n,5}]] (* Harvey P. Dale, Sep 13 2014 *)
  • PARI
    apply( {A007931(n)=fromdigits([d+1|d<-binary(n+1)[^1]])}, [1..44]) \\ M. F. Hasler, Nov 03 2020, replacing older code from Mar 26 2015
    
  • PARI
    /* inverse function */ apply( {A007931_inv(N)=fromdigits([d-1|d<-digits(N)],2)+2<M. F. Hasler, Nov 09 2020
    
  • Python
    def a(n): return int(bin(n+1)[3:].replace('1', '2').replace('0', '1'))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, May 13 2021
    
  • Python
    def A007931(n): return int(s:=bin(n+1)[3:])+(10**(len(s))-1)//9 # Chai Wah Wu, Jun 13 2025

Formula

To get a(n), write n+1 in base 2, remove initial 1, add 1 to all remaining digits: e.g., eleven (11) in base 2 is 1011; remove initial 1 and add 1 to remaining digits: a(10)=122. - Clark Kimberling, Mar 11 2003
Conversely, given a(n), to get n: subtract 1 from all digits, prefix with an initial 1, convert this binary number to base 10, subtract 1. E.g., a(6)=22 -> 11 -> 111 -> 7 -> 6. - N. J. A. Sloane, Jul 09 2012
a(n) = A053645(n+1)+A002275(A000523(n)) = a(n-2^b(n))+10^b(n) where b(n) = A059939(n) = floor(log_2(n+1)-1). - Henry Bottomley, Feb 14 2001
From Hieronymus Fischer, Jun 06 2012 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1 and 2.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 2)*10^j, where m = floor(log_2(n+1)), b(j) = floor((n+1-2^m)/(2^j)).
Special values:
a(k*(2^n-1)) = k*(10^n-1)/9, k= 1,2.
a(3*2^n-2) = (11*10^n-2)/9 = 10^n+2*(10^n-1)/9.
a(2^n-2) = 2*(10^(n-1)-1)/9, n>1.
Inequalities:
a(n) <= (10^log_2(n+1)-1)/9, equality holds for n=2^k-1, k>0.
a(n) > (2/10)*(10^log_2(n+1)-1)/9.
Lower and upper limits:
lim inf a(n)/10^log_2(n) = 1/45, for n --> infinity.
lim sup a(n)/10^log_2(n) = 1/9, for n --> infinity.
G.f.: g(x) = (1/(x(1-x)))*sum_{j=0..infinity} 10^j* x^(2*2^j)*(1 + 2 x^2^j)/(1 + x^2^j).
Also: g(x) = (1/(1-x))*(h_(2,0)(x) + h_(2,1)(x) - 2*h_(2,2)(x)), where h_(2,k)(x) = sum_{j>=0} 10^j*x^(2^(j+1)-1)*x^(k*2^j)/(1-x^2^(j+1)).
Also: g(x) = (1/(1-x)) sum_{j>=0} (1 - 3(x^2^j)^2 + 2(x^2^j)^3)*x^2^j*f_j(x)/(1-x^2^j), where f_j(x) = 10^j*x^(2^j-1)/(1-(x^2^j)^2). The f_j obey the recurrence f_0(x) = 1/(1-x^2), f_(j+1)(x) = 10x*f_j(x^2). (End)

Extensions

Some crossrefs added by Hieronymus Fischer, Jun 06 2012
Edited by M. F. Hasler, Mar 26 2015

A020458 Primes that contain digits 2 and 3 only.

Original entry on oeis.org

2, 3, 23, 223, 233, 2333, 3323, 23333, 32233, 32323, 33223, 222323, 232333, 233323, 323233, 323333, 333233, 333323, 2222333, 2223233, 2232323, 2233223, 2332333, 2333323, 3222223, 3223223, 3223333, 3233323, 3233333, 3332233, 3333233, 22222223, 22223323, 22232233
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{2,3},n],PrimeQ],{n,7}]] (* Harvey P. Dale, Jul 13 2012 *)
  • PARI
    go(n)=my(v=List([2]),x,t); for(d=1,n, x=10^d\9*2; forstep(i=1,2^d-1,2, if(ispseudoprime(t=x+fromdigits(binary(i))), listput(v,t)))); Vec(v) \\ Charles R Greathouse IV, Sep 14 2015
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [2, 3]
        for d in count(2):
            for first in product("23", repeat=d-1):
                t = int("".join(first) + "3")
                if isprime(t): yield t
    print(list(islice(agen(), 34))) # Michael S. Branicky, Jun 08 2022

Extensions

Edited by N. J. A. Sloane, Jul 27 2008 at the suggestion of Dmitry Kamenetsky.
Edited by Charles R Greathouse IV, Mar 17 2010

A256290 Numbers which have only digits 4 and 5 in base 10.

Original entry on oeis.org

4, 5, 44, 45, 54, 55, 444, 445, 454, 455, 544, 545, 554, 555, 4444, 4445, 4454, 4455, 4544, 4545, 4554, 4555, 5444, 5445, 5454, 5455, 5544, 5545, 5554, 5555, 44444, 44445, 44454, 44455, 44544, 44545, 44554, 44555, 45444, 45445, 45454, 45455, 45544
Offset: 1

Views

Author

M. F. Hasler, Mar 27 2015

Keywords

Crossrefs

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9).

Programs

  • Magma
    [n: n in [1..60000] | Set(IntegerToSequence(n, 10)) subset {5, 4}];
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {4,5}]; // Vincenzo Librandi, Aug 19 2016
    
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{4,5},n],{n,5}]]
  • PARI
    A256290(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*4
    
  • Python
    def A256290(n): return int(bin(n+1)[3:])+(10**((n+1).bit_length()-1)-1<<2)//9 # Chai Wah Wu, Jul 15 2023

Formula

a(n) = A007931(n) + A002277(A000523(n+1)) = A032834(n) + A256077(n) etc.

A256291 Numbers which have only digits 5 and 6 in base 10.

Original entry on oeis.org

5, 6, 55, 56, 65, 66, 555, 556, 565, 566, 655, 656, 665, 666, 5555, 5556, 5565, 5566, 5655, 5656, 5665, 5666, 6555, 6556, 6565, 6566, 6655, 6656, 6665, 6666, 55555, 55556, 55565, 55566, 55655, 55656, 55665, 55666, 56555, 56556
Offset: 1

Views

Author

M. F. Hasler, Mar 27 2015

Keywords

Crossrefs

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9).

Programs

  • Magma
    [n: n in [1..60000] | Set(IntegerToSequence(n, 10)) subset {5, 6}];
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {5,6}]; // :Vincenzo Librandi_, Aug 19 2016
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{5,6},n],{n,5}]]
  • PARI
    A256291(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*5
    

Formula

a(n) = A007931(n) + A002278(A000523(n+1)) = A256290(n) + A256077(n) etc.

A031955 Numbers with exactly two distinct base-10 digits.

Original entry on oeis.org

10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 101, 110, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 131, 133, 141, 144, 151, 155, 161, 166
Offset: 1

Views

Author

Keywords

Comments

The three-digit terms are given by A210666(1,...,244). For numbers with exactly two distinct (but unspecified) digits in other bases, see A031948-A031954. For numbers made of two *given* digits, see A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9), and A032804-A032816 (in other bases). - M. F. Hasler, Apr 04 2015
A235154 is a subsequence. - Altug Alkan, Dec 03 2015
A235717 is a subsequence. - Robert Israel, Dec 03 2015

Crossrefs

Programs

  • Haskell
    a031955 n = a031955_list !! (n-1)
    a031955_list = filter ((== 2) . a043537) [0..]
    -- Reinhard Zumkeller, Feb 05 2012
    
  • Maple
    M:= 5: # to get all terms < 10^M
    sort([seq(seq(seq(seq(add(10^(m-j)*`if`(member(j,S2),d2,d1),j=1..m)  ,
      S2 = combinat:-powerset({$2..m}) minus {{}}),
      d2 = {$0..9} minus {d1}), d1 = 1..9), m=2..M)]); # Robert Israel, Dec 03 2015
  • Mathematica
    Select[Range@ 166, Length@ Union@ IntegerDigits@ # == 2 &] (* Michael De Vlieger, Dec 03 2015 *)
  • PARI
    is_A031955(n)=#Set(digits(n))==2 \\ M. F. Hasler, Apr 04 2015
    
  • Python
    def ok(n): return len(set(str(n))) == 2
    print(list(filter(ok, range(167)))) # Michael S. Branicky, Oct 12 2021

Formula

A043537(a(n)) = 2. - Reinhard Zumkeller, Dec 03 2009

Extensions

Name edited by Charles R Greathouse IV, Feb 13 2017

A032834 Numbers with digits 3 and 4 only.

Original entry on oeis.org

3, 4, 33, 34, 43, 44, 333, 334, 343, 344, 433, 434, 443, 444, 3333, 3334, 3343, 3344, 3433, 3434, 3443, 3444, 4333, 4334, 4343, 4344, 4433, 4434, 4443, 4444, 33333, 33334, 33343, 33344, 33433, 33434, 33443, 33444, 34333, 34334
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A032829-A032833 (in other bases), A102659 (Lyndon words in this sequence), A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9).

Programs

  • Magma
    [n: n in [1..35000] | Set(IntegerToSequence(n, 10)) subset {3, 4}]; // Vincenzo Librandi, May 30 2012
    
  • Maple
    S[1]:= [3,4]:
    for d from 2 to 5 do S[d]:= map(t -> (10*t+3,10*t+4), S[d-1]) od:
    seq(op(S[d]),d=1..5); # Robert Israel, Apr 03 2017
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{3,4},n],{n,5}]] (* Vincenzo Librandi, May 30 2012 *)
  • PARI
    A032834(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\3 \\ M. F. Hasler, Mar 27 2015

Formula

a(n) = A007931(n) + A002276(A000523(n+1)) = A032810(n) + A256077(n) etc. - M. F. Hasler, Mar 27 2015
From Robert Israel, Apr 03 2017: (Start)
a(2*n+1) = 10*a(n)+3.
a(2*n+2) = 10*a(n)+4.
G.f. g(x) satisfies g(x) = 10*(x+x^2)*g(x^2) + x*(3+4*x)/(1-x^2). (End)

Extensions

Crossrefs added by M. F. Hasler, Mar 27 2015
Name corrected by Robert Israel, Apr 03 2017

A256292 Numbers which have only digits 6 and 7 in base 10.

Original entry on oeis.org

6, 7, 66, 67, 76, 77, 666, 667, 676, 677, 766, 767, 776, 777, 6666, 6667, 6676, 6677, 6766, 6767, 6776, 6777, 7666, 7667, 7676, 7677, 7766, 7767, 7776, 7777, 66666, 66667, 66676, 66677, 66766, 66767, 66776, 66777, 67666, 67667
Offset: 1

Views

Author

M. F. Hasler, Mar 27 2015

Keywords

Crossrefs

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256340 (digits 7 & 8), A256341 (digits 8 & 9).

Programs

  • Magma
    [n: n in [1..35000] | Set(IntegerToSequence(n, 10)) subset {7, 6}];
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {6,7}]; // Vincenzo Librandi, Aug 19 2016
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{6,7},n],{n,5}]]
  • PARI
    A256292(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*6
    

Formula

a(n) = A007931(n) + A002279(A000523(n+1)) = A256291(n) + A256077(n) etc.

A256340 Numbers which have only digits 7 and 8 in base 10.

Original entry on oeis.org

7, 8, 77, 78, 87, 88, 777, 778, 787, 788, 877, 878, 887, 888, 7777, 7778, 7787, 7788, 7877, 7878, 7887, 7888, 8777, 8778, 8787, 8788, 8877, 8878, 8887, 8888, 77777, 77778, 77787, 77788, 77877, 77878, 77887, 77888, 78777, 78778, 78787, 78788, 78877, 78878
Offset: 1

Views

Author

M. F. Hasler, Mar 27 2015

Keywords

Crossrefs

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5), A256291 (digits 5 & 6), A256292 (digits 6 & 7), A256341 (digits 8 & 9).

Programs

  • Magma
    [n: n in [1..35000] | Set(IntegerToSequence(n, 10)) subset {7, 8}];
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {7,8}]; // Vincenzo Librandi, Aug 19 2016
    
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{7,8},n],{n,5}]]
  • PARI
    A256340(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*7
    
  • Python
    def a(n): return int(bin(n+1)[3:].replace('0', '7').replace('1', '8'))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Jul 08 2021

Formula

a(n) = A007931(n) + A002280(A000523(n+1)) = A256292(n) + A256077(n) etc.

A185969 Let S be the sequence of power towers built of 2 and 3 sorted by their height and for equal heights - in lexicographic order: 2, 3, 2^2, 2^3, 3^2, 3^3, 2^2^2, 2^2^3 etc. A(n) = the permutation of indexes which reorders S by magnitude.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 11, 8, 9, 12, 13, 15, 23, 10, 14, 19, 27, 16, 24, 17, 25, 20, 28, 21, 29, 31, 47, 39, 55, 18, 26, 22, 30, 35, 51, 43, 59, 32, 48, 40, 56, 33, 49, 41, 57, 36, 52, 44, 60, 37, 53, 45, 61, 63, 95, 79, 111, 71, 103, 87, 119, 34, 50, 42, 58, 38
Offset: 1

Views

Author

Vladimir Reshetnikov, Feb 07 2011

Keywords

Examples

			a(6) =  7; tower(7)  = 2^2^2 = 2^4 =  16.
a(7) =  6; tower(6)  = 3^3   =        27.
a(8) = 11; tower(11) = 3^2^2 = 3^4 =  81.
a(9) =  8; tower(8)  = 2^2^3 = 2^8 = 256.
		

Crossrefs

Cf. A032810, A081241, A248907, A256179, A256231, A375374 (colexicographic instead of lexicographic order).

Formula

a(2*n-1) = A081241(2*A081241(a(n-1))+1) and a(2*n) = A081241(A081241(a(2*n-1))+1) for n >= 7. - Pontus von Brömssen, Aug 10 2024

Extensions

More terms from Alois P. Heinz, Apr 05 2011

A256341 Numbers which have only digits 8 and 9 in base 10.

Original entry on oeis.org

8, 9, 88, 89, 98, 99, 888, 889, 898, 899, 988, 989, 998, 999, 8888, 8889, 8898, 8899, 8988, 8989, 8998, 8999, 9888, 9889, 9898, 9899, 9988, 9989, 9998, 9999, 88888, 88889, 88898, 88899, 88988, 88989, 88998, 88999, 89888, 89889
Offset: 1

Views

Author

M. F. Hasler, Mar 27 2015

Keywords

Crossrefs

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5) - A256292 (digits 6 & 7), A256340 (digits 7 & 8).

Programs

  • Magma
    [n: n in [1..35000] | Set(IntegerToSequence(n, 10)) subset {8, 9}];
    
  • Magma
    [n: n in [1..100000] | Set(Intseq(n)) subset {8,9}]; // Vincenzo Librandi, Aug 19 2016
    
  • Mathematica
    Flatten[Table[FromDigits[#,10]&/@Tuples[{8,9},n],{n,5}]]
  • PARI
    A256341(n)=vector(#n=binary(n+1)[2..-1],i,10^(#n-i))*n~+10^#n\9*8
    
  • Python
    def a(n): return int(bin(n+1)[3:].replace('0', '8').replace('1', '9'))
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Aug 09 2021

Formula

a(n) = A007931(n) + A002281(A000523(n+1)) = A256341(n) + A256077(n) etc.
Showing 1-10 of 27 results. Next