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

A033042 Sums of distinct powers of 5.

Original entry on oeis.org

0, 1, 5, 6, 25, 26, 30, 31, 125, 126, 130, 131, 150, 151, 155, 156, 625, 626, 630, 631, 650, 651, 655, 656, 750, 751, 755, 756, 775, 776, 780, 781, 3125, 3126, 3130, 3131, 3150, 3151, 3155, 3156, 3250, 3251, 3255, 3256, 3275, 3276, 3280, 3281, 3750, 3751
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-5 digits larger than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011
Values of k where A008977(k) does not end with 0. - Henry Bottomley, Nov 09 2022

Crossrefs

For generating functions Product_{k>=0} (1 + a*x^(b^k)) for the following values of (a,b) see: (1,2) A000012 and A000027, (1,3) A039966 and A005836, (1,4) A151666 and A000695, (1,5) A151667 and A033042, (2,2) A001316, (2,3) A151668, (2,4) A151669, (2,5) A151670, (3,2) A048883, (3,3) A117940, (3,4) A151665, (3,5) A151671, (4,2) A102376, (4,3) A151672, (4,4) A151673, (4,5) A151674.
Row 5 of array A104257.

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 5
        end
    r end; [a(n) for n in 0:49] |> println # Peter Luschny, Jan 03 2021
    
  • Maple
    a:= proc(n) local m, r, b; m, r, b:= n, 0, 1;
          while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*5 od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 16 2013
  • Mathematica
    t = Table[FromDigits[RealDigits[n, 2], 5], {n, 1, 100}]
    (* Clark Kimberling, Aug 02 2012 *)
    FromDigits[#,5]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 22 2018 *)
  • PARI
    a(n) = subst(Pol(binary(n)), 'x, 5);
    vector(50, i, a(i-1))  \\ Gheorghe Coserea, Sep 15 2015
    
  • PARI
    a(n)=fromdigits(binary(n),5) \\ Charles R Greathouse IV, Jan 11 2017
    
  • Python
    def A033042(n): return int(bin(n)[2:],5) # Chai Wah Wu, Oct 30 2024

Formula

a(n) = Sum_{i=0..m} d(i)*5^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
Numbers j such that the coefficient of x^j is > 0 in Product_{k>=0} (1 + x^(5^k)). - Benoit Cloitre, Jul 29 2003
a(n) = A097251(n)/4.
a(2n) = 5*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*5^k. - Philippe Deléham, Oct 17 2011
liminf a(n)/n^(log(5)/log(2)) = 1/4 and limsup a(n)/n^(log(5)/log(2)) = 1. - Gheorghe Coserea, Sep 15 2015
G.f.: (1/(1 - x))*Sum_{k>=0} 5^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004

A104257 Square array T(a,n) read by antidiagonals: replace 2^i with a^i in binary representation of n, where a,n >= 2.

Original entry on oeis.org

2, 3, 3, 4, 4, 4, 5, 5, 9, 5, 6, 6, 16, 10, 6, 7, 7, 25, 17, 12, 7, 8, 8, 36, 26, 20, 13, 8, 9, 9, 49, 37, 30, 21, 27, 9, 10, 10, 64, 50, 42, 31, 64, 28, 10, 11, 11, 81, 65, 56, 43, 125, 65, 30, 11, 12, 12, 100, 82, 72, 57, 216, 126, 68, 31, 12, 13, 13, 121, 101, 90, 73, 343
Offset: 2

Views

Author

Ralf Stephan, Mar 05 2005

Keywords

Comments

Sums of distinct powers of a. Numbers having only {0,1} in a-ary representation.

Examples

			Array begins:
  2,  3,  4,  5,  6,  7,   8,   9, ...
  3,  4,  9, 10, 12, 13,  27,  28, ...
  4,  5, 16, 17, 20, 21,  64,  65, ...
  5,  6, 25, 26, 30, 31, 125, 126, ...
  6,  7, 36, 37, 42, 43, 216, 217, ...
  7,  8, 49, 50, 56, 57, 343, 344, ...
  8,  9, 64, 65, 72, 73, 512, 513, ...
  9, 10, 81, 82, 90, 91, 729, 730, ...
  ...
		

Crossrefs

Programs

  • Mathematica
    T[, 0] = 0; T[2, n] := n; T[a_, 2] := a;
    T[a_, n_] := T[a, n] = If[EvenQ[n], a T[a, n/2], a T[a, (n-1)/2]+1];
    Table[T[a-n+2, n], {a, 2, 13}, {n, 2, a}] // Flatten (* Jean-François Alcover, Feb 09 2021 *)
  • PARI
    T(a, n) = fromdigits(binary(n), a); \\ Michel Marcus, Aug 19 2022
  • Python
    def T(a, n): return n if n < 2 else (max(a, n) if min(a, n) == 2 else a*T(a, n//2) + n%2)
    print([T(a-n+2, n) for a in range(2, 14) for n in range(2, a+1)]) # Michael S. Branicky, Aug 02 2022
    

Formula

T(a, n) = (1/(a-1))*Sum_{j>=1} floor((n+2^(j-1))/2^j) * ((a-2)*a^(j-1) + 1).
T(a, n) = (1/(a-1))*Sum_{j=1..n} ((a-2)*a^A007814(j) + 1).
G.f. of a-th row: (1/(1-x)) * Sum_{k>=0} a^k*x^2^k/(1+x^2^k).
Recurrence: T(a, 2n) = a*T(a, n), T(a, 2n+1) = a*T(a, n) + 1, T(a, 0) = 0.

A033045 Sums of distinct powers of 8.

Original entry on oeis.org

0, 1, 8, 9, 64, 65, 72, 73, 512, 513, 520, 521, 576, 577, 584, 585, 4096, 4097, 4104, 4105, 4160, 4161, 4168, 4169, 4608, 4609, 4616, 4617, 4672, 4673, 4680, 4681, 32768, 32769, 32776, 32777, 32832, 32833, 32840, 32841, 33280, 33281, 33288
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-8 digits greater than 1.
Every nonnegative n is a unique sum of the form a(p)+2a(q)+4a(r). This gives a one-to-one map of the set N_0 of all nonnegative integers to (N_0)^3. Furthermore, if, for a fixed positive integer m, to consider all sums of distinct powers of 2^m, then one can obtain a one-to-one map of the set N_0 to (N_0)^m. - Vladimir Shevelev, Nov 15 2008

Examples

			a(7)=72 because 72_10 = 110_8.
		

Crossrefs

Row 8 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*8^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097254(n)/7.
a(2n) = 8*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*8^k. - Philippe Deléham, Oct 19 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 8^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

More terms from Patrick De Geest, Dec 23 2000

A077720 Primes which can be expressed as sum of distinct powers of 6.

Original entry on oeis.org

7, 37, 43, 223, 1297, 1303, 1549, 7993, 9109, 46663, 54469, 55987, 281233, 326593, 327889, 335917, 1679653, 1679659, 1679833, 1680919, 1681129, 1687393, 1726273, 1726489, 1727569, 1727827, 1734049, 1960891, 1961107, 1967587, 2006461
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 6 representation contains only zeros and 1's.

Crossrefs

Programs

  • Mathematica
    Select[FromDigits[#,6]&/@Tuples[{0,1},9],PrimeQ] (* Harvey P. Dale, May 01 2018 *)

Extensions

More terms from Sascha Kurz, Jan 03 2003

A033046 Sums of distinct powers of 9.

Original entry on oeis.org

0, 1, 9, 10, 81, 82, 90, 91, 729, 730, 738, 739, 810, 811, 819, 820, 6561, 6562, 6570, 6571, 6642, 6643, 6651, 6652, 7290, 7291, 7299, 7300, 7371, 7372, 7380, 7381, 59049, 59050, 59058, 59059, 59130, 59131, 59139, 59140, 59778, 59779, 59787
Offset: 0

Views

Author

Keywords

Comments

Numbers without any base-9 digits greater than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011

Crossrefs

Row 9 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*9^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097255(n)/8.
a(2n) = 9*a(n), a(2n+1) = a(2n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*9^k. - Philippe Deléham, Oct 17 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 9^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004

A033044 Sums of distinct powers of 7.

Original entry on oeis.org

0, 1, 7, 8, 49, 50, 56, 57, 343, 344, 350, 351, 392, 393, 399, 400, 2401, 2402, 2408, 2409, 2450, 2451, 2457, 2458, 2744, 2745, 2751, 2752, 2793, 2794, 2800, 2801, 16807, 16808, 16814, 16815, 16856, 16857, 16863, 16864, 17150, 17151, 17157
Offset: 1

Views

Author

Keywords

Comments

Numbers without any base-7 digits greater than 1.
a(n) modulo 2 is the Prouhet-Thue-Morse sequence A010060. - Philippe Deléham, Oct 17 2011
Note that this sequence has offset 1, in contrast to A000695 and all others among A033043-A033052. - M. F. Hasler, Feb 01 2016

Crossrefs

Row 7 of array A104257.

Programs

Formula

a(n) = Sum_{i=0..m} d(i)*7^i, where Sum_{i=0..m} d(i)*2^i is the base-2 representation of n.
a(n) = A097253(n)/6.
a(2n) = 7*a(n), a(2n+1) = a(2n)+1.
a(n+1) = Sum_{k>=0} A030308(n,k)*7^k. - Philippe Deléham, Oct 17 2011
G.f.: (x/(1 - x))*Sum_{k>=0} 7^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Extended by Ray Chandler, Aug 03 2004
Karol Bacik has pointed out that the first three formulas do not match the sequence. - N. J. A. Sloane, Oct 20 2012

A097252 Numbers whose set of base 6 digits is {0,5}.

Original entry on oeis.org

0, 5, 30, 35, 180, 185, 210, 215, 1080, 1085, 1110, 1115, 1260, 1265, 1290, 1295, 6480, 6485, 6510, 6515, 6660, 6665, 6690, 6695, 7560, 7565, 7590, 7595, 7740, 7745, 7770, 7775, 38880, 38885, 38910, 38915, 39060, 39065, 39090, 39095, 39960, 39965
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 6 for every i.

Crossrefs

Programs

  • Magma
    [n: n in [0..40000] | Set(IntegerToSequence(n, 6)) subset {0, 5}]; // Vincenzo Librandi, May 25 2012
    
  • Mathematica
    fQ[n_]:=Union@Join[{0,5},IntegerDigits[n,6]]=={0,5};Select[Range[0,40000],fQ] (* Vincenzo Librandi, May 25 2012 *)
    FromDigits[#,6]&/@Tuples[{ 0,5},6] (* Harvey P. Dale, Aug 15 2021 *)
  • Python
    def A079252(n): return 5*int(bin(n)[2:],6) # Chai Wah Wu, Apr 04 2025

Formula

a(n) = 5*A033043(n).
a(2n) = 6*a(n), a(2n+1) = a(2n)+5.

A063012 Sum of distinct powers of 20; i.e., numbers with digits in {0,1} base 20; i.e., write n in base 2 and read as if written in base 20.

Original entry on oeis.org

0, 1, 20, 21, 400, 401, 420, 421, 8000, 8001, 8020, 8021, 8400, 8401, 8420, 8421, 160000, 160001, 160020, 160021, 160400, 160401, 160420, 160421, 168000, 168001, 168020, 168021, 168400, 168401, 168420, 168421, 3200000, 3200001, 3200020, 3200021, 3200400, 3200401
Offset: 0

Views

Author

Henry Bottomley, Jul 04 2001

Keywords

Examples

			a(5) = 401 since 5 written in base 2 is 101 so a(5) = 1*20^2 + 0*20^1 + 1*20^0 = 400 + 0 + 1 = 401.
		

Crossrefs

A063013 is similar in a different way.

Programs

  • Maple
    a:= proc(n) `if`(n<2, n, irem(n, 2, 'r')+20*a(r)) end:
    seq(a(n), n=0..37);  # Alois P. Heinz, Apr 04 2025
  • Mathematica
    Table[FromDigits[IntegerDigits[n,2],20],{n,0,40}] (* Harvey P. Dale, Jul 21 2014 *)
  • PARI
    baseE(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) }
    baseI(x, b)= { local(d, e, f); e=0; f=1; while (x>0, d=x-10*(x\10); x\=10; e+=d*f; f*=b); return(e) }
    { for (n=0, 1000, write("b063012.txt", n, " ", baseI(baseE(n, 2), 20)) ) } \\ Harry J. Smith, Aug 15 2009
    
  • Python
    def A063012(n): return int(bin(n)[2:],20) # Chai Wah Wu, Apr 04 2025

Formula

a(n) = a(n-2^floor(log_2(n))) + 20^floor(log_2(n)). a(2n) = 20*a(n); a(2n+1) = a(2n)+1 = 20*a(n)+1.
a(n) = Sum_{k>=0} A030308(n,k)*A009964(k). - Philippe Deléham, Oct 15 2011
G.f.: (1/(1 - x))*Sum_{k>=0} 20^k*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jun 04 2017

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A341907 T(n, k) is the result of replacing 2^e with k^e in the binary expansion of n; square array T(n, k) read by antidiagonals upwards, n, k >= 0.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 2, 2, 1, 0, 1, 1, 3, 3, 1, 0, 0, 2, 4, 4, 4, 1, 0, 1, 2, 5, 9, 5, 5, 1, 0, 0, 3, 6, 10, 16, 6, 6, 1, 0, 1, 1, 7, 12, 17, 25, 7, 7, 1, 0, 0, 2, 8, 13, 20, 26, 36, 8, 8, 1, 0, 1, 2, 9, 27, 21, 30, 37, 49, 9, 9, 1, 0, 0, 3, 10, 28, 64, 31, 42, 50, 64, 10, 10, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Jun 04 2021

Keywords

Comments

For any n >= 0, the n-th row, k -> T(n, k), corresponds to a polynomial in k with coefficients in {0, 1}.
For any k > 1, the k-th column, n -> T(n, k), corresponds to sums of distinct powers of k.

Examples

			Array T(n, k) begins:
  n\k|  0  1   2   3   4    5    6    7    8    9    10    11    12
  ---+-------------------------------------------------------------
    0|  0  0   0   0   0    0    0    0    0    0     0     0     0
    1|  1  1   1   1   1    1    1    1    1    1     1     1     1
    2|  0  1   2   3   4    5    6    7    8    9    10    11    12
    3|  1  2   3   4   5    6    7    8    9   10    11    12    13
    4|  0  1   4   9  16   25   36   49   64   81   100   121   144
    5|  1  2   5  10  17   26   37   50   65   82   101   122   145
    6|  0  2   6  12  20   30   42   56   72   90   110   132   156
    7|  1  3   7  13  21   31   43   57   73   91   111   133   157
    8|  0  1   8  27  64  125  216  343  512  729  1000  1331  1728
    9|  1  2   9  28  65  126  217  344  513  730  1001  1332  1729
   10|  0  2  10  30  68  130  222  350  520  738  1010  1342  1740
   11|  1  3  11  31  69  131  223  351  521  739  1011  1343  1741
   12|  0  2  12  36  80  150  252  392  576  810  1100  1452  1872
		

Crossrefs

Programs

  • PARI
    T(n,k) = { my (v=0, e); while (n, n-=2^e=valuation(n,2); v+=k^e); v }

Formula

T(n, n) = A104258(n).
T(n, 0) = A000035(n).
T(n, 1) = A000120(n).
T(n, 2) = n.
T(n, 3) = A005836(n).
T(n, 4) = A000695(n).
T(n, 5) = A033042(n).
T(n, 6) = A033043(n).
T(n, 7) = A033044(n).
T(n, 8) = A033045(n).
T(n, 9) = A033046(n).
T(n, 10) = A007088(n).
T(n, 11) = A033047(n).
T(n, 12) = A033048(n).
T(n, 13) = A033049(n).
T(0, k) = 0.
T(1, k) = 1.
T(2, k) = k.
T(3, k) = k + 1.
T(4, k) = k^2.
T(5, k) = k^2 + 1 = A002522(k).
T(6, k) = k^2 + k = A002378(k).
T(7, k) = k^2 + k + 1 = A002061(k).
T(8, k) = k^3.
T(9, k) = k^3 + 1 = A001093(k).
T(10, k) = k^3 + k = A034262(k).
T(11, k) = k^3 + k + 1 = A071568(k).
T(12, k) = k^3 + k^2 = A011379(k).
T(13, k) = k^3 + k^2 + 1 = A098547(k).
T(14, k) = k^3 + k^2 + k = A027444(k).
T(15, k) = k^3 + k^2 + k + 1 = A053698(k).
T(16, k) = k^4 = A000583(k).
T(17, k) = k^4 + 1 = A002523(k).
T(m + n, k) = T(m, k) + T(n, k) when m AND n = 0 (where AND denotes the bitwise AND operator).

A037411 Positive numbers having the same set of digits in base 2 and base 6.

Original entry on oeis.org

1, 6, 7, 36, 37, 42, 216, 217, 222, 223, 252, 253, 258, 1296, 1297, 1302, 1303, 1332, 1333, 1338, 1339, 1512, 1513, 1518, 1519, 1548, 1549, 1554, 7776, 7777, 7782, 7783, 7812, 7813, 7818, 7819, 7992, 7993, 7998, 7999, 8028
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A033043.

Programs

  • PARI
    isok(n) = Set(digits(n, 2)) == Set(digits(n, 6)); \\ John Cerkan, Jan 11 2017
Showing 1-10 of 11 results. Next