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 15 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

A014261 Numbers that contain odd digits only.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 31, 33, 35, 37, 39, 51, 53, 55, 57, 59, 71, 73, 75, 77, 79, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139, 151, 153, 155, 157, 159, 171, 173, 175, 177, 179, 191, 193, 195, 197, 199, 311, 313, 315, 317, 319
Offset: 1

Views

Author

Keywords

Comments

Or, numbers whose product of digits is odd.
Complement of A007928; A196563(a(n)) = 0. - Reinhard Zumkeller, Oct 04 2011
If n is represented as a zerofree base-5 number (see A084545) according to n = d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j = 0..m} c(d(j))*10^j, where c(k) = 1, 3, 5, 7, 9 for k = 1..5. - Hieronymus Fischer, Jun 06 2012

Examples

			a(10^3) = 13779.
a(10^4) = 397779.
a(10^5) = 11177779.
a(10^6) = 335777779.
		

Crossrefs

Subsequence of A059708 and of A225985. A066640 and A030096 are subsequences.

Programs

  • Haskell
    a014261 n = a014261_list !! (n-1)
    a014261_list = filter (all (`elem` "13579") . show) [1,3..]
    -- Reinhard Zumkeller, Jul 05 2011
    
  • Magma
    [ n : n in [1..129] | IsOdd(&*Intseq(n,10)) ];
    
  • Mathematica
    Select[Range[400], OddQ[Times@@IntegerDigits[#]] &] (* Alonso del Arte, Feb 21 2014 *)
  • PARI
    is(n)=Set(digits(n)%2)==[1] \\ Charles R Greathouse IV, Jul 06 2017
    
  • PARI
    a(n)={my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k} \\ Andrew Howroyd, Jan 17 2020
    
  • Python
    from itertools import islice, count
    def A014261(): return filter(lambda n: set(str(n)) <= {'1','3','5','7','9'}, count(1,2))
    A014261_list = list(islice(A014261(),20)) # Chai Wah Wu, Nov 22 2021
    
  • Python
    from itertools import count, islice, product
    def agen(): yield from (int("".join(p)) for d in count(1) for p in product("13579", repeat=d))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 13 2022

Formula

A121759(a(n)) = a(n); A000035(A007959(a(n))) = 1. - Reinhard Zumkeller, Nov 30 2007
From Reinhard Zumkeller, Aug 30 2009: (Start)
a(n+1) - a(n) = A164898(n). - Reinhard Zumkeller, Aug 30 2009
a(n+1) = h(a(n)) with h(x) = 1 + (if x mod 10 < 9 then x + x mod 2 else 10*h(floor(x/10)));
a(n) = f(n, 1) where f(n, x) = if n = 1 then x else f(n-1, h(x)). (End)
From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = Sum_{j = 0..m-1} ((2*b_j(n)+1) mod 10)*10^j, where b_j(n) = floor((4*n+1-5^m)/(4*5^j)), m = floor(log_5(4*n+1)).
a(1*(5^n-1)/4) = 1*(10^n-1)/9.
a(2*(5^n-1)/4) = 1*(10^n-1)/3.
a(3*(5^n-1)/4) = 5*(10^n-1)/9.
a(4*(5^n-1)/4) = 7*(10^n-1)/9.
a(5*(5^n-1)/4) = 10^n - 1.
a((5^n-1)/4 + 5^(n-1)-1) = (10^n-5)/5.
a(n) = (10^log_5(4*n+1)-1)/9 for n = (5^k-1)/4, k > 0.
a(n) < (10^log_5(4*n+1)-1)/9 for (5^k-1)/4 < n < (5^(k+1)-1)/4, k > 0.
a(n) <= 27/(9*2^log_5(9)-1)*(10^log_5(4*n+1)-1)/9 for n > 0, equality holds for n = 2.
a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n > 0.
a(n) >= A001742(n), equality holds for n = (5^k-1)/4, k > 0.
a(n) = A084545(n) if and only if all digits of A084545(n) are 1, else a(n) > A084545(n).
G.f.: g(x)= (x^(1/4)*(1-x))^(-1) Sum_{j >= 0} 10^j*z(j)^(5/4)*(1-z(j))*(1 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3 + 9*z(j)^4)/(1-z(j)^5), where z(j) = x^5^j.
Also: g(x) = (1/(1-x))*(h_(5,0)(x) + 2*h_(5,1)(x) + 2*h_(5,2)(x) + 2*h_(5,3)(x) + 2*h_(5,4)(x) - 9*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)
a(n) = A225985(A226091(n)). - Reinhard Zumkeller, May 26 2013
Sum_{n>=1} 1/a(n) = A194181. - Bernard Schott, Jan 13 2022

Extensions

More terms from Robert G. Wilson v, Oct 18 2002
Examples and crossrefs added by Hieronymus Fischer, Jun 06 2012

A202268 Numbers in which all digits are nonprimes (1, 4, 6, 8, 9).

Original entry on oeis.org

1, 4, 6, 8, 9, 11, 14, 16, 18, 19, 41, 44, 46, 48, 49, 61, 64, 66, 68, 69, 81, 84, 86, 88, 89, 91, 94, 96, 98, 99, 111, 114, 116, 118, 119, 141, 144, 146, 148, 149, 161, 164, 166, 168, 169, 181, 184, 186, 188, 189, 191, 194, 196, 198, 199, 411, 414, 416, 418, 419
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

Supersequence of A029581.
Subsequence of A084984.
If n-1 is represented as a zerofree base-5 number (see A084545) according to n-1=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j=0..m} c(d(j))*10^j, where c(k)=1,4,6,8,9 for k=1..5. - Hieronymus Fischer, May 30 2012

Examples

			From _Hieronymus Fischer_, May 30 2012: (Start)
a(1000) = 14889.
a(10^4) = 498889
a(10^5) = 11188889.
a(10^6) = 446888889. (End)
		

Crossrefs

Cf. A046034 (numbers in which all digits are primes), A001742 (numbers in which all digits are noncomposites excluding 0), A202267 (numbers in which all digits are noncomposites), A084984 (numbers in which all digits are nonprimes), A029581 (numbers in which all digits are composites).

Programs

  • Magma
    [n: n in [1..500] | Set(Intseq(n)) subset [1, 4, 6, 8, 9]]; // Vincenzo Librandi, Dec 17 2018
  • Mathematica
    Table[FromDigits/@Tuples[{1, 4, 6, 8, 9}, n], {n, 3}] // Flatten (* Vincenzo Librandi, Dec 17 2018 *)

Formula

From Hieronymus Fischer, May 30 2012: (Start)
a(n) = Sum_{j=0..m-1} ((2*b_j(n)+1) mod 10 + floor((b_j(n)+4)/5) - floor((b_j(n)+1)/5))*10^j, where b_j(n))=floor((4*n+1-5^m)/(4*5^j)), m=floor(log_5(4*n+1)).
a(1*(5^n-1)/4) = 1*(10^n-1)/9.
a(2*(5^n-1)/4) = 4*(10^n-1)/9.
a(3*(5^n-1)/4) = 6*(10^n-1)/9.
a(4*(5^n-1)/4) = 8*(10^n-1)/9.
a(5*(5^n-1)/4) = 10^n-1.
a(n) = (10^log_5(4*n+1)-1)/9 for n=(5^k-1)/4, k>0.
a(n) <= 36/(9*2^log_5(9)-1)*(10^log_5(4*n+1)-1)/9 for n>0, equality holds for n=2.
a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n>0.
a(n) >= A001742(n), equality holds for n=(5^k-1)/4, k>0.
a(n) = A084545(n) iff all digits of A084545(n) are 1, a(n)>A084545(n), else.
G.f.: g(x) = (x^(1/4)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(5/4)*(1-z(j))*(1 + 4z(j) + 6*z(j)^2 + 8*z(j)^3 + 9*z(j)^4)/(1-z(j)^5), where z(j)=x^5^j.
Also: g(x) = (1/(1-x))*(h_(5,0)(x) + 3h_(5,1)(x) + 2h_(5,2)(x) + 2h_(5,3)(x) + h_(5,4)(x) - 9*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)
Sum_{n>=1} 1/a(n) = 2.897648425695540438556738520657902585305276107220152307051361916356295164643... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

A202267 Numbers in which all digits are noncomposites (1, 2, 3, 5, 7) or 0.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 10, 11, 12, 13, 15, 17, 20, 21, 22, 23, 25, 27, 30, 31, 32, 33, 35, 37, 50, 51, 52, 53, 55, 57, 70, 71, 72, 73, 75, 77, 100, 101, 102, 103, 105, 107, 110, 111, 112, 113, 115, 117, 120, 121, 122, 123, 125, 127, 130, 131, 132, 133, 135, 137, 150
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

If n-1 is represented as a base-6 number (see A007092) according to n-1=d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n)= sum_{j=0..m} c(d(j))*10^j, where c(k)=0,1,2,3,5,7 for k=0..5. - Hieronymus Fischer, May 30 2012

Examples

			a(1000) = 5353.
a(10^4) = 115153
a(10^5) = 2070753.
a(10^6) = 33233353.
		

Crossrefs

Supersequence of A001742 and A046034.
Cf. A046034 (numbers in which all digits are primes), A001742 (numbers in which all digits are noncomposites excluding 0), A202268 (numbers in which all digits are nonprimes excluding 0), A084984 (numbers in which all digits are nonprimes), A029581 (numbers in which all digits are composites).

Programs

  • Mathematica
    Union[Flatten[FromDigits/@Tuples[{0,1,2,3,5,7},3]]] (* Harvey P. Dale, Mar 11 2015 *)

Formula

From Hieronymus Fischer, May 30 2012: (Start)
a(n) = (b_m(n)+1) mod 10 + floor((b_m(n)+2)/5) + floor((b_m(n)+1)/5) - 2*floor(b_m(n)/5))*10^m + sum_{j=0..m-1} (b_j(n) mod 6 + floor((b_j(n)+1)/6) + floor((b_j(n)+2)/6) - 2*floor(b_j(n)/6)))*10^j, where n>1, b_j(n)) = floor((n-1-6^m)/6^j), m = floor(log_6(n-1)).
a(1*6^n+1) = 1*10^n.
a(2*6^n+1) = 2*10^n.
a(3*6^n+1) = 3*10^n.
a(4*6^n+1) = 5*10^n.
a(5*6^n+1) = 7*10^n.
a(n) = 10^log_6(n-1) for n=6^k+1, k>0,
a(n) < 10^log_6(n-1) else.
a(n) = A007092(n-1) iff the digits of A007092(n-1) are <= 3, a(n)>A007092(n-1), else.
a(n) <= A084984(n), equality holds if the representation of n-1 as a base-6 number only has digits 0 or 1.
G.f.: g(x) = (x/(1-x))*sum_{j>=0} 10^j*x^6^j *(1-x^6^j)* (1 + 2x^6^j + 3(x^2)^6^j + 5(x^3)^6^j + 7(x^4)^6^j)/(1-x^6^(j+1)).
Also: g(x) = (x/(1-x))*(h_(6,1)(x) + h_(6,2)(x) + h_(6,3)(x) + 2*h_(6,4)(x) + 2*h_(6,5)(x) - 7*h_(6,6)(x)), where h_(6,k)(x) = sum_{j>=0} 10^j*x^(k*6^j)/(1-x^6^(j+1)). (End)
Sum_{n>=2} 1/a(n) = 4.945325883472729555972742252181522711968119529132581193614012706741310832798... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

Examples added by Hieronymus Fischer, May 30 2012

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

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

A064692 Total number of holes in decimal expansion of the number n, assuming 4 has 1 hole.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 2, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 2, 1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 3, 2, 2, 2, 3, 2, 3, 2, 4, 3, 2, 1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 1, 1, 2
Offset: 0

Views

Author

Matthew Conroy, Oct 11 2001

Keywords

Examples

			We assume decimal digits 1,2,3,5,7 have no hole; 0,4,6,9 have one hole each; 8 has two holes. So a(148)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[DigitCount[x].{0, 0, 0, 1, 0, 1, 0, 2, 1, 1}, {x, 0, 104}] (* Zak Seidov, Jul 25 2015 *)
  • Python
    def A064692(n):
        x=str(n)
        return x.count("0")+x.count("4")+x.count("6")+x.count("8")*2+x.count("9") # Indranil Ghosh, Feb 02 2017

Formula

a(A001742(n)) = 0. - Michel Marcus, Jul 25 2015

A190222 Noncomposite numbers all of whose decimal digits are noncomposite numbers (1,2,3,5,7).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 71, 73, 113, 127, 131, 137, 151, 157, 173, 211, 223, 227, 233, 251, 257, 271, 277, 311, 313, 317, 331, 337, 353, 373, 521, 523, 557, 571, 577, 727, 733, 751, 757, 773, 1117, 1123, 1151, 1153, 1171, 1213, 1217, 1223
Offset: 1

Views

Author

Jaroslav Krizek, May 06 2011

Keywords

Crossrefs

Subsequence of A001742.

Programs

  • Magma
    [1] cat [n: n in PrimesUpTo(1223) | Set(Intseq(n)) subset [1, 2, 3, 5, 7]]; // Arkadiusz Wesolowski, Apr 16 2014
    
  • Mathematica
    Join[{1}, Select[Range[2000], PrimeQ[#] && Intersection[{0, 4, 6, 8, 9}, IntegerDigits[#]] == {} &]] (* T. D. Noe, May 09 2011 *)
  • PARI
    is(k) = if(!isprime(k) && k != 1, return(0)); setminus(vecsort(digits(k), , 8), [1, 2, 3, 5, 7]) == [] \\ Iain Fox, Dec 28 2017
    
  • PARI
    is(n) = if(isprime(n), #setminus(Set(digits(k)), [1,2,3,5,7])==0, n==1) \\ Charles R Greathouse IV, Dec 28 2017

Formula

a(n) >> n^k where k = log(10)/log(5) = 1.43067.... - Charles R Greathouse IV, Dec 28 2017

A001729 List of numbers whose digits contain no loops (version 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 11, 12, 13, 14, 15, 17, 21, 22, 23, 24, 25, 27, 31, 32, 33, 34, 35, 37, 41, 42, 43, 44, 45, 47, 51, 52, 53, 54, 55, 57, 71, 72, 73, 74, 75, 77, 111, 112, 113, 114, 115, 117, 121, 122, 123, 124, 125, 127, 131, 132, 133, 134, 135, 137, 141, 142
Offset: 1

Views

Author

Keywords

Comments

The digits 0, 6, 8 and 9 contain loops, but 1, 2, 3, 4 (written in "open" style), 5 and 7 do not.

Crossrefs

Cf. A001742 (version 2).

Programs

  • Mathematica
    Select[Range[150], Intersection[{0, 6, 8, 9}, Union[IntegerDigits[#]]] == {} &] (* T. D. Noe, Aug 10 2012 *)
    FromDigits/@Flatten[Table[Tuples[{1,2,3,4,5,7},n],{n,3}],1] (* Harvey P. Dale, Feb 01 2017 *)

Formula

Sum_{n>=1} 1/a(n) = 5.427161361994446672956800952211331066904630376796246807177210248900020978222... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 15 2024

Extensions

Missing 42 and 44 added by T. D. Noe, Aug 10 2012
Showing 1-10 of 15 results. Next