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.

Previous Showing 21-30 of 86 results. Next

A007932 Numbers that contain only 1's, 2's and 3's.

Original entry on oeis.org

1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33, 111, 112, 113, 121, 122, 123, 131, 132, 133, 211, 212, 213, 221, 222, 223, 231, 232, 233, 311, 312, 313, 321, 322, 323, 331, 332, 333, 1111, 1112, 1113, 1121, 1122, 1123, 1131, 1132, 1133, 1211, 1212, 1213, 1221
Offset: 1

Views

Author

R. Muller

Keywords

Comments

This sequence is the alternate number system in base 3. - Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003
a(n) is the "bijective base-k numeration" or "k-adic notation" for k=3. - Chris Gaconnet (gaconnet(AT)gmail.com), May 27 2009
a(n) = n written in base 3 where zeros are not allowed but threes are. The three distinct digits used are 1, 2 and 3 instead of 0, 1 and 2. To obtain this sequence from the "canonical" base 3 sequence with zeros allowed, just replace any 0 with a 3 and then subtract one from the group of digits situated on the left: (20-->13; 100-->23; 110-->33; 1000-->223; 1010-->233). This can be done in any integer positive base b, replacing zeros with positive b's and subtracting one from the group of digits situated on the left. And zero is the only digit that can be replaced, since there is always a more significant digit greater than 0, on the left, from which to subtract one. - Robin Garcia, Jan 07 2014

Examples

			a(100)  = 3131.
a(10^3) = 323231.
a(10^4) = 111123331.
a(10^5) = 11231311131.
a(10^6) = 1212133131231.
a(10^7) = 123133223331331.
a(10^8) = 13221311111312131.
a(10^9) = 2113123122313232231.
- _Hieronymus Fischer_, Jun 06 2012
		

References

  • 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.
  • A. Salomaa, Formal Languages, Academic Press, 1973. pages 90-91. [From Chris Gaconnet (gaconnet(AT)gmail.com), May 27 2009]

Crossrefs

Programs

  • Mathematica
    NextNbr[n_] := Block[{d = IntegerDigits[n + 1], l}, l = Length[d]; While[l != 1, If[ d[[l]] > 3, d[[l - 1]]++; d[[l]] = 1]; l-- ]; If[ d[[1]] > 3, d[[1]] = 11]; FromDigits[d]]; NestList[ NextNbr, 1, 51]
    Table[FromDigits/@Tuples[{1,2,3},n],{n,4}]//Flatten (* Harvey P. Dale, Mar 29 2018 *)
  • PARI
    a(n) = my (w=3); while (n>w, n -= w; w *= 3); my (d=digits(w+n-1, 3)); d[1] = 0; fromdigits(d) + (10^(#d-1)-1)/9 \\ Rémy Sigrist, Aug 28 2018

Formula

From Hieronymus Fischer, May 30 2012 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1, 2, 3.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 3)*10^j,
where m = floor(log_3(2*n+1)), b(j) = floor((2*n+1-3^m)/(2*3^j)).
Special values:
a(k*(3^n-1)/2) = k*(10^n-1)/9, k=1,2,3.
a((5*3^n-3)/2) = (4*10^n-1)/3 = 10^n + (10^n-1)/3.
a((3^n-1)/2 - 1) = (10^(n-1)-1)/3, n>1.
Inequalities:
a(n) <= (10^log_3(2*n+1)-1)/9, equality holds for n=(3^k-1)/2, k>0.
a(n) > (3/10)*(10^log_3(2*n+1)-1)/9, n>0.
Lower and upper limits:
lim inf a(n)/10^log_3(2*n) = 1/30, for n --> infinity.
lim sup a(n)/10^log_3(2*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/2)*(1-x))^(-1) Sum_{j=>0} 10^j*(x^3^j)^(3/2) * (1-x^3^j)*(1 + 2x^3^j + 3x^(2*3^j))/(1 - x^3^(j+1)).
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1 - 4(x^3^j)^3 + 3(x^3^j)^4)*x^3^j*f_j(x)/(1-x^3^j), where f_j(x) = 10^j*x^((3^j-1)/2)/(1-(x^3^j)^3). The f_j obey the recurrence f_0(x) = 1/(1-x^3), f_(j+1)(x) = 10x*f_j(x^3).
Also: g(x) = (1/(1-x))*(h_(3,0)(x) + h_(3,1)(x) + h_(3,2)(x) - 3*h_(3,3)(x)), where h_(3,k)(x) = Sum_{j>=0} 10^j*x^((3^(j+1)-1)/2) * (x^3^j)^k/(1-(x^3^j)^3).
(End)

Extensions

Edited and extended by Robert G. Wilson v, Dec 14 2002
Crossrefs added by Hieronymus Fischer, Jun 06 2012

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.

A014701 Number of multiplications to compute n-th power by the Chandah-sutra method.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, 5, 6, 6, 7, 6, 7, 7, 8, 6, 7, 7, 8, 7, 8, 8, 9, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 6, 7, 7, 8, 7, 8, 8, 9, 7, 8, 8, 9, 8, 9, 9, 10, 7, 8, 8, 9, 8, 9, 9
Offset: 1

Views

Author

James Kilfiger (jamesk(AT)maths.warwick.ac.uk)

Keywords

Comments

In other words, number of steps to reach 1 starting from n and using the process: x -> x-1 if n is odd and x -> x/2 otherwise.
a(n) = number of 0's + twice number of 1's (disregarding the leading digit 1) in the binary expansion of n, i.e., A007088(n). - Lekraj Beedassy, May 28 2010
From Daniel Forgues, Jul 31 2012: (Start)
For the binary Fibonacci rabbits sequence (A036299) (cf. OEIS Wiki link below) we have the substitution/concatenation rule: a(n), n >= 3, may be obtained by the concatenation of a(n-1) and a(n-2), with a(1) = 0, a(2) = 1. Thus, using . (dot) as the concatenation operator, we have the recursive substitution/concatenation
a(n) = a(n-0)
a(n) = a(n-1).a(n-2)
a(n) = a(n-2).a(n-3).a(n-3).a(n-4)
a(n) = a(n-3).a(n-4).a(n-4).a(n-5).a(n-4).a(n-5).a(n-5).a(n-6)
which suggests the sequence
{0}
{1, 2}
{2, 3, 3, 4}
{3, 4, 4, 5, 4, 5, 5, 6}
whose concatenation gives A014701 (this sequence).
Number of multiplications to compute n-th power by the Chandah-sutra method, also called left-to-right binary exponentiation:
x^1 = x^( 1_2) = (x) (0 prod)
x^2 = x^( 10_2) = (x^2) (1 prod)
x^3 = x^( 11_2) = (x^2) * (x) (2 prod)
x^4 = x^( 100_2) = (x^2)^2 (2 prod)
x^5 = x^( 101_2) = (x^2)^2 * (x) (3 prod)
x^6 = x^( 110_2) = (x^2)^2 * (x^2) (3 prod)
x^7 = x^( 111_2) = (x^2)^2 * (x^2) * (x) (4 prod)
x^8 = x^(1000_2) = ((x^2)^2)^2 (3 prod) (End)
From Ya-Ping Lu, Mar 03 2021: (Start)
Index at which record m occurs is A052955(m).
First appearance of m in the sequence (or the record value m) is at n = 2^(m/2 + 1) - 1 for even m, and at n = 3*2^((m - 1)/2) - 1 for odd m.
The last appearance of m in the sequence is at n = 2^m. (End)
a(n) is the digit sum of n-1 in bijective base-2. Since the Fibonacci number F(m) can be defined as the number of ways to compose m as the sum of 1s and 2s, we get that m appears F(m) times in the sequence. - Oscar Cunningham, Apr 14 2024
Conjecture: a(n+1) is the minimal number of steps to go from 0 to n, by choosing before each step, after the first step, whether to keep the same step length or double it. The initial step length is 1. - Jean-Marc Rebert, May 15 2025

Examples

			5 -> 4 -> 2 -> 1 so 3 steps are needed to reach 1 hence a(5)=3; 9 -> 8 -> 4 -> 2 -> 1 hence a(9)=4.
		

Crossrefs

Programs

  • Haskell
    a014701 1 = 0
    a014701 n = a007953 $ a007931 (n - 1)
    -- Reinhard Zumkeller, Oct 26 2012
    
  • Maple
    A014701 := proc(n) local j,k; j := n; k := 0; while(j>1) do if j mod 2=1 then j := j-1 else j := j/2 fi; k := k+1 od end;
    # second Maple program:
    a:= n-> add(i+1, i=Bits[Split](n))-2:
    seq(a(n), n=1..128);  # Alois P. Heinz, Aug 30 2021
  • Mathematica
    a[n_] := DigitCount[n, 2] /. {x_, y_} -> 2x + y - 2; Array[a, 100] (* Robert G. Wilson v, Jul 31 2012 *)
  • PARI
    a(n)=hammingweight(n)+logint(n,2)-1 \\ Charles R Greathouse IV, Dec 29 2016
    
  • Python
    def a(n):
        if n==1:
            return 0
        return a(n//2)+1+n%2
    for i in range(1,60):
        print(a(i), end=", ")
    # Pablo Hueso Merino, Oct 28 2020

Formula

a(n) = A056792(n) - 1 = A056791(n) - 2.
a(n) = floor(log_2(n)) + (number of 1's in binary representation of n) - 1. - Corrected (- 1 at end) by Daniel Forgues, Aug 01 2012
a(2^n) = n, a(2^n-1) = 2*(n-1), and for n >= 2, log_2(n) <= a(n) <= 2*log_2(n) - 1. - Robert FERREOL, Oct 01 2014
Let u(1) = 1, u(2*n) = u(n)+1, u(2*n+1) = u(2*n)+1; then a(1) = 0 and a(n) = u(n-1). - Benoit Cloitre, Dec 19 2002
G.f.: -2/(1-x) + (1/(1-x)) * Sum_{k>=0} (2*x^2^k + x^2^(k+1))/(1+x^2^k). - Ralf Stephan, Aug 15 2003
From {0}, apply the substitution rule (n -> n+1, n+2) repeatedly, giving {{0}, {1, 2}, {2, 3, 3, 4}, {3, 4, 4, 5, 4, 5, 5, 6}, ...} and concatenate. - Daniel Forgues, Jul 31 2012
For n > 1: a(n) = A007953(A007931(n-1)). - Reinhard Zumkeller, Oct 26 2012
a(n) >= A003313(n). - Charles R Greathouse IV, Jan 03 2018
a(n) = a(floor(n/2)) + 1 + (n mod 2) for n > 1. - Pablo Hueso Merino, Oct 28 2020
a(n+1) = max_{1<=i<=n} (H(i) + H(n-i)) where H(n) denotes the Hamming weight of n (A000120(n)). See Lemma 8 in Gruber/Holzer 2021 article. - Hermann Gruber, Jun 26 2024

A020450 Primes that contain digits 1 and 2 only.

Original entry on oeis.org

2, 11, 211, 2111, 2221, 12211, 21121, 21211, 21221, 22111, 111121, 111211, 112111, 112121, 1111211, 1121221, 1212121, 1212221, 1221221, 2121121, 2211211, 2221111, 11221211, 12111221, 12121121, 12121211, 12122111, 12122221, 12212111, 12222121
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A020449 (digits 0 & 1), ..., A020472 (digits 8 & 9). [From M. F. Hasler, Mar 18 2010]
Subsequence of A007931.

Programs

  • Magma
    [p: p in PrimesUpTo(12222121) | Set(Intseq(p)) subset [1, 2]]; // Vincenzo Librandi, Jul 28 2012
    
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,2},n],PrimeQ],{n,8}]] (* Vincenzo Librandi, Jul 28 2012 *)
  • PARI
    for(nd=1,9, forvec(v=vector(nd,i,[49,50-(i==nd && i>1)]), isprime(t=eval(Strchr(Vecsmall(v)))) && print1(t","))) \\ M. F. Hasler, Mar 18 2010
    
  • Python
    from sympy import primerange
    def checkd(a, c):
        b =  set(int(i) for i in set(str(a)))
        return b.issubset(c)
    for n in primerange(2, 2000000):
        if checkd(n, [1, 2]):
            print(n)
    # Abhiram R Devesh, May 08 2015

A214676 A(n,k) is n represented in bijective base-k numeration; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 1, 11, 1, 2, 111, 1, 2, 11, 1111, 1, 2, 3, 12, 11111, 1, 2, 3, 11, 21, 111111, 1, 2, 3, 4, 12, 22, 1111111, 1, 2, 3, 4, 11, 13, 111, 11111111, 1, 2, 3, 4, 5, 12, 21, 112, 111111111, 1, 2, 3, 4, 5, 11, 13, 22, 121, 1111111111
Offset: 1

Views

Author

Alois P. Heinz, Jul 25 2012

Keywords

Comments

The digit set for bijective base-k numeration is {1, 2, ..., k}.

Examples

			Square array A(n,k) begins:
:         1,   1,  1,  1,  1,  1,  1,  1, ...
:        11,   2,  2,  2,  2,  2,  2,  2, ...
:       111,  11,  3,  3,  3,  3,  3,  3, ...
:      1111,  12, 11,  4,  4,  4,  4,  4, ...
:     11111,  21, 12, 11,  5,  5,  5,  5, ...
:    111111,  22, 13, 12, 11,  6,  6,  6, ...
:   1111111, 111, 21, 13, 12, 11,  7,  7, ...
:  11111111, 112, 22, 14, 13, 12, 11,  8, ...
		

Crossrefs

A(n+1,n) gives A010850.

Programs

  • Maple
    A:= proc(n, b) local d, l, m; m:= n; l:= NULL;
          while m>0 do  d:= irem(m, b, 'm');
            if d=0 then d:=b; m:=m-1 fi;
            l:= d, l
          od; parse(cat(l))
        end:
    seq(seq(A(n, 1+d-n), n=1..d), d=1..12);
  • Mathematica
    A[n_, b_] := Module[{d, l, m}, m = n; l = Nothing; While[m > 0, {m, d} = QuotientRemainder[m, b]; If[d == 0, d = b; m--]; l = {d, l}]; FromDigits @ Flatten @ l];
    Table[A[n, d-n+1], {d, 1, 12}, {n, 1, d}] // Flatten (* Jean-François Alcover, May 28 2019, from Maple *)

A084544 Alternate number system in base 4.

Original entry on oeis.org

1, 2, 3, 4, 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44, 111, 112, 113, 114, 121, 122, 123, 124, 131, 132, 133, 134, 141, 142, 143, 144, 211, 212, 213, 214, 221, 222, 223, 224, 231, 232, 233, 234, 241, 242, 243, 244, 311, 312, 313, 314, 321
Offset: 1

Views

Author

Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003

Keywords

Examples

			From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(100)  = 1144.
a(10^3) = 33214.
a(10^4) = 2123434.
a(10^5) = 114122134.
a(10^6) = 3243414334.
a(10^7) = 211421121334.
a(10^8) = 11331131343334.
a(10^9) = 323212224213334. (End)
		

Crossrefs

Programs

  • Python
    def A084544(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join((str(((3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3)+1) for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

From Hieronymus Fischer, Jun 06 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1..4.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 4)*10^j,
where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
Special values:
a(k*(4^n-1)/3) = k*(10^n-1)/9, k = 1,2,3,4.
a((7*4^n-4)/3) = (13*10^n-4)/9 = 10^n + 4*(10^n-1)/9.
a((4^n-1)/3 - 1) = 4*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_4(3*n+1)-1)/9, equality holds for n=(4^k-1)/3, k>0.
a(n) > (4/10)*(10^log_4(3*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_4(3*n) = 2/45, for n --> infinity.
lim sup a(n)/10^log_4(3*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1 - 5z(j)^4 + 4z(j)^5)/((1-z(j))(1-z(j)^4)), where z(j) = x^4^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1-5(x^4^j)^4 + 4(x^4^j)^5)*x^4^j*f_j(x)/(1-x^4^j), where f_j(x) = 10^j*x^((4^j-1)/3)/(1-(x^4^j)^4). The f_j obey the recurrence f_0(x) = 1/(1-x^4), f_(j+1)(x) = 10x*f_j(x^4).
Also: g(x) = (1/(1-x))* (h_(4,0)(x) + h_(4,1)(x) + h_(4,2)(x) + h_(4,3)(x) - 4*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3) * (x^4^j)^k/(1-(x^4^j)^4).
(End)
a(n) = A045926(n) / 2. - Reinhard Zumkeller, Jan 01 2013

Extensions

Offset set to 1 according to A007931, A007932 by Hieronymus Fischer, Jun 06 2012

A084545 Alternate number system in base 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55, 111, 112, 113, 114, 115, 121, 122, 123, 124, 125, 131, 132, 133, 134, 135, 141, 142, 143, 144, 145, 151, 152, 153, 154, 155, 211, 212, 213, 214, 215, 221, 222
Offset: 1

Views

Author

Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003

Keywords

Examples

			From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(100)  = 345.
a(10^3) = 12445.
a(10^4) = 254445.
a(10^5) = 11144445.
a(10^6) = 223444445.
a(10^7) = 4524444445.
a(10^8) = 145544444445.
a(10^9) = 3521444444445. (End)
		

Crossrefs

Programs

  • PARI
    a(n) = my (w=5); while (n>w, n -= w; w *= 5); my (d=digits(w+n-1, 5)); d[1] = 0; fromdigits(d) + (10^(#d-1)-1)/9 \\ Rémy Sigrist, Dec 04 2019

Formula

From Hieronymus Fischer, Jun 06 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1..5.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 5)*10^j, where m = floor(log_5(4*n+1)), b(j) = floor((4*n+1-5^m)/(4*5^j)).
a(k*(5^n-1)/4) = k*(10^n-1)/9, for k = 1,2,3,4,5.
a((9*5^n-5)/4) = (14*10^n-5)/9 = 10^n + 5*(10^n-1)/9.
a((5^n-1)/4 - 1) = 5*(10^(n-1)-1)/9, n>1.
a(n) <= (10^log_5(4*n+1)-1)/9, equality holds for n=(5^k-1)/4, k>0.
a(n) > (5/10)*(10^log_5(4*n+1)-1)/9, n>0.
lim inf a(n)/10^log_5(4*n) = 1/18, for n --> infinity.
lim sup a(n)/10^log_5(4*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/4)*(1-x))^(-1) sum_{j>=0} 10^j*z(j)^(5/4)*(1 - 6z(j)^5 + 5z(j)^6)/((1-z(j))(1-z(j)^5)), where z(j) = x^5^j.
Also: g(x) = (1/(1-x)) sum_{j>=0} (1-6(x^5^j)^5+5(x^5^j)^6)*x^5^j*f_j(x)/(1-x^5^j), where f_j(x) = 10^j*x^((5^j-1)/4)/(1-(x^5^j)^5). The f_j obey the recurrence f_0(x) = 1/(1-x^5), f_(j+1)(x) = 10x*f_j(x^5).
Also: g(x) = 1/(1-x))*(h_(5,0)(x) + h_(5,1)(x) + h_(5,2)(x) + h_(4,1)(x) + h_(5,4)(x) - 5*h_(5,5)(x)), where h_(5,k)(x) = sum_{j>=0} 10^j*x^((5^(j+1)-1)/4) * (x^5^j)^k/(1-(x^5^j)^5).
(End)

Extensions

Offset set to 1 according to A007931, A007932 and more terms added by Hieronymus Fischer, Jun 06 2012

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.

A214218 List of words over {1,2} with equal numbers of 1's and 2's.

Original entry on oeis.org

12, 21, 1122, 1212, 1221, 2112, 2121, 2211, 111222, 112122, 112212, 112221, 121122, 121212, 121221, 122112, 122121, 122211, 211122, 211212, 211221, 212112, 212121, 212211, 221112, 221121, 221211, 222111, 11112222, 11121222, 11122122, 11122212, 11122221
Offset: 1

Views

Author

N. J. A. Sloane, Jul 18 2012

Keywords

Comments

Of course the empty word also has this property.
All of these, interpreted as decimal integers are divisible by 3, because each pair of "1" and "2" contributes a digital sum of 3, hence the total is divisible by 3. Is there a semiprime in the sequence after 21? - Jonathan Vos Post, Jul 18 2012
The semiprime subsequence contains 21, 11222121, 12122211, 21221121, 22211121, 22212111, and continues with 14 10-digit entries etc. - R. J. Mathar, Jul 19 2012

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 2.

Crossrefs

Subsequence of A007931, A111066.

Programs

  • Maple
    sort([seq(seq((10^(2*d)-1)/9+add(10^i,i=s),s=combinat:-choose([$0..(2*d-1)],d)),d=1..4)]); # Robert Israel, Jan 02 2018
  • Mathematica
    Sort[FromDigits/@Flatten[Table[Permutations[PadRight[{},2n,{1,2}]],{n,3}],1]] (* Harvey P. Dale, Aug 30 2016 *)
  • Python
    from itertools import count, islice
    from sympy.utilities.iterables import multiset_permutations as mp
    def agen():
        for d in count(2, 2):
            for s in mp("1"*(d//2) + "2"*(d//2), d):
                yield int("".join(s))
    print(list(islice(agen(), 33))) # Michael S. Branicky, Dec 21 2021

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.
Previous Showing 21-30 of 86 results. Next