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 31-40 of 354 results. Next

A033016 Numbers whose base-3 expansion has no run of digits with length < 2.

Original entry on oeis.org

4, 8, 13, 26, 36, 40, 44, 72, 76, 80, 108, 117, 121, 125, 134, 216, 229, 234, 238, 242, 324, 328, 332, 351, 360, 364, 368, 377, 396, 400, 404, 648, 652, 656, 684, 688, 692, 702, 715, 720, 724, 728, 972, 976, 980, 985, 998, 1053
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A007089. Supersequence of A033001.

Programs

  • Mathematica
    Select[Range[10000], Min[Length/@Split[IntegerDigits[#, 3]]]>1&] (* Vincenzo Librandi, Feb 05 2014 *)

A037314 Numbers whose base-3 and base-9 expansions have the same digit sum.

Original entry on oeis.org

0, 1, 2, 9, 10, 11, 18, 19, 20, 81, 82, 83, 90, 91, 92, 99, 100, 101, 162, 163, 164, 171, 172, 173, 180, 181, 182, 729, 730, 731, 738, 739, 740, 747, 748, 749, 810, 811, 812, 819, 820, 821, 828, 829, 830, 891, 892, 893, 900, 901, 902, 909, 910, 911
Offset: 0

Views

Author

Keywords

Comments

a(n) = Sum_{i=0..m} d(i)*9^i, where Sum_{i=0..m} d(i)*3^i is the base-3 representation of n.
Numbers that can be written using only digits 0, 1 and 2 in base 9. Also, write n in base 3, read as base 9: (3) [n] (9) in base change notation. a(3n+k) = 9a(n)+k for k in {0,1,2}. - Franklin T. Adams-Watters, Jul 24 2006
Also, every term k corresponds to a unique pair i,j with k = a(i) + 3*a(j) (similarly to the Moser-de Bruijn sequence). - Luis Rato, May 02 2024

Crossrefs

Cf. A007089, A208665, A338086 (ternary digit duplication).

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 3)
            r += b * q
            b *= 9
        end
    r end
    [a(n) for n in 0:53] |> println # Peter Luschny, Jan 03 2021
  • Mathematica
    Table[FromDigits[RealDigits[n, 3], 9], {n, 1, 100}] (* Clark Kimberling, Aug 14 2012 *)
    Select[Range[0,1000],Total[IntegerDigits[#,3]]==Total[IntegerDigits[#,9]]&] (* Harvey P. Dale, Feb 17 2020 *)
  • PARI
    a(n) = {my(d = digits(n, 3)); subst(Pol(d), x, 9);} \\ Michel Marcus, Apr 09 2015
    

Formula

G.f. f(x) = Sum_{j>=0} 9^j*x^(3^j)*(1+x^(3^j)-2*x^(2*3^j))/((1-x)*(1-x^(3^(j+1)))) satisfies f(x) = 9*(x^2+x+1)*f(x^3) + x*(1+2*x)/(1-x^3). - Robert Israel, Apr 13 2015

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 08 2007
Offset changed to 0 by Clark Kimberling, Aug 14 2012

A081605 Numbers having at least one 0 in their ternary representation.

Original entry on oeis.org

0, 3, 6, 9, 10, 11, 12, 15, 18, 19, 20, 21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 45, 46, 47, 48, 51, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 69, 72, 73, 74, 75, 78, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 23 2003

Keywords

Comments

Complement of A032924.
A212193(a(n)) <> 0. [Reinhard Zumkeller, May 04 2012]

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a081605 n = a081605_list !! (n-1)
    a081605_list = findIndices (/= 0) a212193_list
    -- Reinhard Zumkeller, May 04 2012
    
  • Mathematica
    Select[Range[0,100],DigitCount[#,3,0]>0&] (* Harvey P. Dale, Aug 10 2021 *)
  • Python
    from itertools import count, islice
    def A081605_gen(): # generator of terms
        a = -1
        for n in count(2):
            b = int(bin(n)[3:],3) + (3**(n.bit_length()-1)-1>>1)
            yield from range(a+1,b)
            a = b
    A081605_list = list(islice(A081605_gen(),30)) # Chai Wah Wu, Oct 13 2023

A118594 Palindromes in base 3 (written in base 3).

Original entry on oeis.org

0, 1, 2, 11, 22, 101, 111, 121, 202, 212, 222, 1001, 1111, 1221, 2002, 2112, 2222, 10001, 10101, 10201, 11011, 11111, 11211, 12021, 12121, 12221, 20002, 20102, 20202, 21012, 21112, 21212, 22022, 22122, 22222, 100001, 101101, 102201, 110011, 111111, 112211, 120021
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Comments

The number of n-digit terms is given by A225367. - M. F. Hasler, May 05 2013 [Moved here on May 08 2013]
Digit-wise application of A000578 (and also superposition of a(n) with its horizontal OR vertical reflection) yields A006072. - M. F. Hasler, May 08 2013
Equivalently, palindromes k (written in base 10) such that 4*k is a palindrome. - Bruno Berselli, Sep 12 2018

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 1110], Max@IntegerDigits@# < 3 &] (* Robert G. Wilson v, May 09 2006 *)
    Select[FromDigits/@Tuples[{0,1,2},8],IntegerDigits[#]==Reverse[ IntegerDigits[ #]]&] (* Harvey P. Dale, Apr 20 2015 *)
  • PARI
    {for(l=1,5,u=vector((l+1)\2,i,10^(i-1)+(2*i-11&&i==1,2]), print1(v*u",")))} \\ The n-th term could be produced by using (partial sums of) A225367 to skip all shorter terms, and then skipping the adequate number of vectors v until n is reached.  - M. F. Hasler, May 08 2013
    
  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [0, 1, 2]
        for d in count(2):
            for start in "12":
                for rest in product("012", repeat=d//2-1):
                    left = start + "".join(rest)
                    for mid in [[""], ["0", "1", "2"]][d%2]:
                        yield int(left + mid + left[::-1])
    print(list(islice(agen(), 42))) # Michael S. Branicky, Mar 29 2022
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118594(n):
        if n == 1: return 0
        y = 3*(x:=3**integer_log(n>>1,3)[0])
        return int((s:=digits(n-x,3))+s[-2::-1] if nChai Wah Wu, Jun 14 2024
  • Sage
    [int(n.str(base=3)) for n in (0..757) if Word(n.digits(3)).is_palindrome()] # Peter Luschny, Sep 13 2018
    

Extensions

More terms from Robert G. Wilson v, May 09 2006
a(40) and beyond from Michael S. Branicky, Mar 29 2022

A136808 Numbers k such that k and k^2 use only the digits 0, 1 and 2.

Original entry on oeis.org

0, 1, 10, 11, 100, 101, 110, 1000, 1001, 1010, 1011, 1100, 1101, 10000, 10001, 10010, 10011, 10100, 10110, 11000, 11001, 11010, 100000, 100001, 100010, 100011, 100100, 100101, 100110, 101000, 101001, 101100, 110000, 110001, 110010, 110100, 1000000, 1000001, 1000010, 1000011, 1000100
Offset: 1

Views

Author

Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008

Keywords

Comments

Generated with DrScheme.
Subsequence of A136809, A136816, ..., A136836. - M. F. Hasler, Jan 24 2008
A278038(18) = 10101, A136827(294) = 10110001101, A136831(1276) = 101100010001101 resp. A136836(1262) = 101090009991101 are the first terms from where on these four sequences differ from the present one. - M. F. Hasler, Nov 15 2017
From Jovan Radenkovicc, Nov 15 2024: (Start)
A nonnegative integer n is in this sequence iff 10*n is also in this sequence.
Not a subsequence of A278038 (binary numbers without '111'). A counterexample is 10^2884 + 10^2880 + 10^2872 + 10^2857 + 10^2497 + 10^2426 + 10^2285 + 10^2004 + 10^1443 + 10^1442 + 10^1441 + 10^881 + 10^600 + 10^459 + 10^388 + 10^27 + 10^12 + 10^4 + 1. There are infinitely many counterexamples not divisible by 10. This counterexample follows from the fact that 111^2+2000*4+200*4=12321+8000+800=21121. In fact, every binary substring will eventually occur in this sequence. Also, if n is a term containing only the digits 0 and 1, then 10^k*n+1 and n+10^k are also in this sequence for any sufficiently large integer k. (End)

Examples

			101000100100001^2 = 10201020220210222010200200001.
		

Crossrefs

A subsequence of the binary numbers A007088.
Cf. A278038.
Cf. A136809, A136810, ..., A137147 for other digit combinations.
See also A058412 = A058411^2: squares having only digits {0,1,2}, A277946 = A277959^2 = squares whose largest digit is 2.

Programs

  • Maple
    isA136808 := proc(n) local ndgs,n2dgs ; ndgs := convert(convert(n,base,10),set) ; n2dgs := convert(convert(n^2,base,10),set) ; if ( (ndgs union n2dgs) minus {0,1,2} ) = {} then true ; else false ; fi ; end: LtonRev := proc(L) local i ; add(op(i,L)*10^(i-1),i=1..nops(L)) ; end: A007089 := proc(n) convert(n,base,3) ; LtonRev(%) ; end: n := 1: for i from 0 do n3 := A007089(i) ; if isA136808(n3) then printf("%d %d ",n,n3) ; n := n+1 ; fi ; od: # R. J. Mathar, Jan 24 2008
  • Mathematica
    Select[FromDigits/@Tuples[{0,1},7],Union[Take[DigitCount[#^2],{3,9}]]=={0}&] (* Harvey P. Dale, May 29 2013 *)
  • PARI
    for(n=1,999,vecmax(digits((N=fromdigits(binary(n),10))^2))<3 && print1(N",")) \\ M. F. Hasler, Nov 15 2017

A265747 Numbers written in Jacobsthal greedy base.

Original entry on oeis.org

0, 1, 2, 10, 11, 100, 101, 102, 110, 111, 200, 1000, 1001, 1002, 1010, 1011, 1100, 1101, 1102, 1110, 1111, 10000, 10001, 10002, 10010, 10011, 10100, 10101, 10102, 10110, 10111, 10200, 11000, 11001, 11002, 11010, 11011, 11100, 11101, 11102, 11110, 11111, 20000, 100000, 100001, 100002, 100010, 100011, 100100
Offset: 0

Views

Author

Antti Karttunen, Dec 17 2015

Keywords

Comments

These are called "Jacobsthal Representation Numbers" in Horadam's 1996 paper.
Sum_{i=0..} digit(i)*A001045(2+digit(i)) recovers n from such representation a(n), where digit(0) stands for the least significant digit (at the right), and A001045(k) gives the k-th Jacobsthal number.
No larger digits than 2 will occur, which allows representing the same sequence in a more compact form by base-3 coding in A265746.
Sequence A197911 gives the terms with no digit "2" in their representation, while its complement A003158 gives the terms where "2" occurs at least once.
Numbers beginning with digit "2" in this representation are given by A020988(n) [= 2*A002450(n) = 2*A001045(2n)].

Examples

			For n=7, when selecting the terms of A001045 with the greedy algorithm, we need terms A001045(4) + A001045(2) + A001045(2) = 5 + 1 + 1, thus a(7) = "102".
For n=10, we need A001045(4) + A001045(4) = 5+5, thus a(10) = "200".
		

Crossrefs

Cf. A265745 (sum of digits).
Cf. A265746 (same numbers interpreted in base-3, then shown in decimal).
Cf. A084639 (positions of repunits).
Cf. A007961, A014417, A014418, A244159 for analogous sequences.

Programs

  • Mathematica
    jacob[n_] := (2^n - (-1)^n)/3; maxInd[n_] := Floor[Log2[3*n + 1]]; A265747[n_] := A265747[n] = 10^(maxInd[n] - 2) + A265747[n - jacob[maxInd[n]]]; A265747[0] = 0; Array[A265747, 100, 0] (* Amiram Eldar, Jul 21 2023 *)
  • PARI
    A130249(n) = floor(log(3*n + 1) / log(2));
    A001045(n) = (2^n - (-1)^n) / 3;
    A265747(n) = {if(n==0, 0, my(d=n - A001045(A130249(n))); 10^(A130249(n)-2) + if(d == 0, 0, A265747(d)));} \\ Amiram Eldar, Jul 21 2023
  • Python
    def greedyJ(n): m = (3*n+1).bit_length() - 1; return (m, (2**m-(-1)**m)//3)
    def a(n):
        if n == 0: return 0
        place, value = greedyJ(n)
        return 10**(place-2) + a(n - value)
    print([a(n) for n in range(49)]) # Michael S. Branicky, Jul 11 2021
    

Formula

a(0) = 0; for n >= 1, a(n) = 10^(A130249(n)-2) + a(n-A001045(A130249(n))).
a(n) = A007089(A265746(n)).

A062891 When expressed in base 3 and then interpreted in base 9, is a multiple of the original number.

Original entry on oeis.org

0, 1, 2, 3, 6, 9, 13, 18, 26, 27, 34, 39, 47, 54, 78, 81, 91, 102, 117, 121, 141, 162, 182, 234, 242, 243, 262, 273, 306, 351, 363, 423, 486, 546, 702, 726, 729, 757, 786, 819, 918, 1048, 1053, 1089, 1093, 1183, 1269, 1458, 1514, 1638, 2106, 2178, 2186, 2187
Offset: 1

Views

Author

Erich Friedman, Jul 21 2001

Keywords

Examples

			13 in base 3 is 111, which interpreted in base 9 is 91 = 7*13.
		

Crossrefs

Cf. A007089 (base 3), A007095 (base 9), A037314 (base 3 -> 9).
Other digit spreads: A062846 (binary), A343550 (decimal).

Programs

  • Maple
    q:= n-> (l-> n=0 or 0=irem(add(l[i]*9^(i-1),
             i=1..nops(l)), n))(convert(n, base, 3)):
    select(q, [$0..3000])[];  # Alois P. Heinz, Apr 20 2021
  • Mathematica
    Join[{0},Select[Range[2200],Divisible[FromDigits[IntegerDigits[#,3],9],#]&]] (* Harvey P. Dale, Apr 11 2017 *)

Extensions

Offset changed to 1 by Kevin Ryde, Apr 24 2021

A065369 Replace 3^k with (-3)^k in ternary expansion of n.

Original entry on oeis.org

0, 1, 2, -3, -2, -1, -6, -5, -4, 9, 10, 11, 6, 7, 8, 3, 4, 5, 18, 19, 20, 15, 16, 17, 12, 13, 14, -27, -26, -25, -30, -29, -28, -33, -32, -31, -18, -17, -16, -21, -20, -19, -24, -23, -22, -9, -8, -7, -12, -11, -10, -15, -14, -13, -54, -53, -52, -57, -56, -55, -60, -59, -58, -45, -44, -43, -48, -47, -46
Offset: 0

Views

Author

Marc LeBrun, Oct 31 2001

Keywords

Comments

Base 3 representation for n (in lexicographic order) converted from base -3 to base 10.
Notation: (3)[n](-3)
Fixed point of the morphism 0-> 0,1,2 ; 1-> -3,-2,-1 ; 2-> -6,-5,-4 ; ...; n-> -3n,-3n+1,-3n+2. - Philippe Deléham, Oct 22 2011

Examples

			15 = +1(9)+2(3)+0(1) -> +1(+9)+2(-3)+0(+1) = +3 = a(15)
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 3]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 3]], {n, 1, 80}]; b
  • PARI
    a(n) = fromdigits(digits(n, 3), -3) \\ Rémy Sigrist, Feb 06 2020

Formula

a(n) = Sum_{k>=0} A030341(n,k)*(-3)^k. - Philippe Deléham, Oct 22 2011
a(3*k+m) = -3*a(k)+m for 0 <= m < 3. - Chai Wah Wu, Jan 16 2020

A255588 Convert n to base 3, move the least significant digit to the most significant one and convert back to base 10.

Original entry on oeis.org

0, 1, 2, 1, 4, 7, 2, 5, 8, 3, 12, 21, 4, 13, 22, 5, 14, 23, 6, 15, 24, 7, 16, 25, 8, 17, 26, 9, 36, 63, 10, 37, 64, 11, 38, 65, 12, 39, 66, 13, 40, 67, 14, 41, 68, 15, 42, 69, 16, 43, 70, 17, 44, 71, 18, 45, 72, 19, 46, 73, 20, 47, 74, 21, 48, 75, 22, 49, 76, 23
Offset: 0

Views

Author

Paolo P. Lava, Feb 27 2015

Keywords

Comments

a(3*n) = n.
Fixed points of the transform are listed in A048328.

Examples

			10 in base 3 is 101: moving the least significant digit to the most significant one we have 110 that is 12 in base 10.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q,h) local a,b,k,n; print(0);
    for n from 1 to q do
    a:=convert(n,base,h); b:=[]; for k from 2 to nops(a) do b:=[op(b),a[k]]; od; a:=[op(b),a[1]];
    a:=convert(a,base,h,10); b:=0; for k from nops(a) by -1 to 1 do b:=10*b+a[k]; od;
    print(b); od; end: P(10^4,3);
  • Mathematica
    roll[n_, b_] := Block[{w = IntegerDigits[n, b]}, Prepend[Most@ w, Last@ w]]; b = 3; FromDigits[#, b] & /@ (roll[#, b] & /@ Range[0, 69]) (* Michael De Vlieger, Mar 04 2015 *)
    Table[FromDigits[RotateRight[IntegerDigits[n,3]],3],{n,0,70}] (* Harvey P. Dale, Feb 20 2022 *)
  • Python
    def A255588(n):
        x=A007089(n)
        return int(x[-1]+x[:-1], 3) # Indranil Ghosh, Feb 03 2017

A370853 Numbers m such that c(0) < c(1) < c(2), where c(k) = number of k's in the ternary representation of m.

Original entry on oeis.org

17, 23, 25, 53, 71, 77, 79, 134, 152, 158, 160, 161, 206, 212, 214, 215, 230, 232, 233, 238, 239, 241, 296, 314, 320, 322, 350, 386, 398, 402, 404, 422, 428, 430, 440, 452, 456, 458, 464, 466, 470, 474, 476, 478, 480, 482, 484, 485, 530, 536, 538, 554, 556
Offset: 1

Views

Author

Clark Kimberling, Mar 03 2024

Keywords

Examples

			The ternary representation of 17 is 122, for which c(0)=0 < c(1)=1 < c(2)=2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], DigitCount[#, 3, 0] < DigitCount[#, 3, 1] < DigitCount[#, 3, 2] &]
  • PARI
    check(m) = {my(c0=0, c1=0, c2=0, s=Vec(digits(m, 3)));
    for(i=1, length(s), if(s[i]==0, c0+=1, if(s[i]==1, c1+=1, if(s[i]==2, c2+=1,))));
    c0John Tyler Rascoe, Mar 11 2024
Previous Showing 31-40 of 354 results. Next