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-4 of 4 results.

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

A322403 Square array T(n, k) read by antidiagonals, n >= 0 and k >= 0: the lengths of runs in binary expansion of T(n, k) are obtained by multiplying those of n and of k (see Comments for precise definition).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 2, 3, 0, 0, 4, 12, 12, 4, 0, 0, 5, 4, 15, 4, 5, 0, 0, 6, 42, 48, 48, 42, 6, 0, 0, 7, 6, 51, 16, 51, 6, 7, 0, 0, 8, 56, 60, 292, 292, 60, 56, 8, 0, 0, 9, 8, 63, 12, 5, 12, 63, 8, 9, 0, 0, 10, 150, 192, 448, 438, 438, 448, 192
Offset: 0

Views

Author

Rémy Sigrist, Dec 06 2018

Keywords

Comments

For any n >= 0 and k >= 0:
- let r_n be the lengths of runs in binary expansion of n,
- for n = 0: we assume that r_0 = (),
- when n > 0: let R_n be the #r_n-periodic sequence whose first #r_n terms match r_n,
- r_{T(n, k)} has lcm(#r_n, #r_k) terms and r_{T(n, k)}(i) = R_n(i) * R_k(i) for i = 1..lcm(#r_n, #r_k).

Examples

			Array T(n, k) begins (in decimal):
  n\k|  0  1   2    3    4     5    6     7     8     9     10
  ---+--------------------------------------------------------
    0|  0  0   0    0    0     0    0     0     0      0     0
    1|  0  1   2    3    4     5    6     7     8      9    10
    2|  0  2   2   12    4    42    6    56     8    150    10
    3|  0  3  12   15   48    51   60    63   192    195   204
    4|  0  4   4   48   16   292   12   448    64   2124    36
    5|  0  5  42   51  292     5  438   455  2184      9  2730
    6|  0  6   6   60   12   438   30   504    24   3294    54
    7|  0  7  56   63  448   455  504   511  3584   3591  3640
    8|  0  8   8  192   64  2184   24  3584   512  33048   136
Array T(n, k) begins (in binary):
   n\k|  0     1      10        11        100          101         110
  ----+---------------------------------------------------------------
     0|  0     0       0         0          0             0          0
     1|  0     1      10        11        100           101        110
    10|  0    10      10      1100        100        101010        110
    11|  0    11    1100      1111     110000        110011     111100
   100|  0   100     100    110000      10000     100100100       1100
   101|  0   101  101010    110011  100100100           101  110110110
   110|  0   110     110    111100       1100     110110110      11110
   111|  0   111  111000    111111  111000000     111000111  111111000
  1000|  0  1000    1000  11000000    1000000  100010001000      11000
		

Crossrefs

See A322404 for the additive variant.

Programs

  • PARI
    T(n,k) = my (v=0, p=1, rn=n, rk=k, b=if ((max(n,1)%2)&&(max(k,1)%2), 1, 0)); while (1, my (vn=if (rn==0, 0, valuation(rn+(rn%2), 2)), vk=if(rk==0, 0, valuation(rk+(rk%2), 2)), w=vn*vk); v+=b*p*(2^w-1); rn\=2^vn; rk\=2^vk; if (rn==0 && rk==0, return (v), rn==0, rn=n, rk==0, rk=k); p*=2^w; b=1-b)

Formula

For any m >= 0, n >= 0 and k >= 0:
- T(n, k) = T(k, n) (T is commutative),
- T(m, T(n, k)) = T(T(m, n), k) (T is associative),
- T(m, A322404(n, k)) = A322404(T(m, n), T(m, k)) (T distributes over A322404),
- T(n, 0) = 0 (0 is an absorbing element for T),
- T(n, 1) = n (1 is an neutral element for T),
- T(n, 3) = A001196(n),
- T(n, 7) = A097254(n+1),
- T(n, 15) = A097262(n),
- T(n, n) = A322149(n),
- A005811(T(n, k)) = lcm(A005811(n), A005811(k)),
- T(2^n - 1, 2^k - 1) = 2^(n*k) - 1.
- T(2^n, 2^k) = 2^(n*k) when n > 0 and k > 0,
- T(n, k) is odd iff both n and k are odd.

A355664 Square array A(n, k), n, k >= 0, read by antidiagonals; for any number n with runs in binary expansion (r_w, ..., r_0), let p(n) be the polynomial of a single indeterminate x where the coefficient of x^e is r_e for e = 0..w and otherwise 0, and let q be the inverse of p; A(n, k) = q(p(n) * p(k)).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 9, 3, 0, 0, 4, 12, 12, 4, 0, 0, 5, 35, 15, 35, 5, 0, 0, 6, 38, 48, 48, 38, 6, 0, 0, 7, 49, 51, 271, 51, 49, 7, 0, 0, 8, 56, 60, 284, 284, 60, 56, 8, 0, 0, 9, 135, 63, 387, 313, 387, 63, 135, 9, 0, 0, 10, 142, 192, 448, 398, 398, 448, 192, 142, 10, 0
Offset: 0

Views

Author

Rémy Sigrist, Jul 13 2022

Keywords

Comments

In other words, A(n, k) encodes the product of the polynomials encoded by n and k.

Examples

			Array A(n, k) begins:
  n\k|  0   1    2    3     4     5     6     7      8      9     10     11
  ---+---------------------------------------------------------------------
    0|  0   0    0    0     0     0     0     0      0      0      0      0
    1|  0   1    2    3     4     5     6     7      8      9     10     11
    2|  0   2    9   12    35    38    49    56    135    142    153    156
    3|  0   3   12   15    48    51    60    63    192    195    204    207
    4|  0   4   35   48   271   284   387   448   2111   2172   2275   2288
    5|  0   5   38   51   284   313   398   455   2168   2289   2502   2531
    6|  0   6   49   60   387   398   481   504   3079   3102   3185   3196
    7|  0   7   56   63   448   455   504   511   3584   3591   3640   3647
    8|  0   8  135  192  2111  2168  3079  3584  33279  33784  34695  34752
    9|  0   9  142  195  2172  2289  3102  3591  33784  34785  36622  36739
   10|  0  10  153  204  2275  2502  3185  3640  34695  36622  39993  40476
   11|  0  11  156  207  2288  2531  3196  3647  34752  36739  40476  40719
   12|  0  12  195  240  3087  3132  3843  4032  49215  49404  50115  50160
		

Crossrefs

Programs

  • PARI
    toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r }
    fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
    A(n,k) = { fromruns(Vec(Pol(toruns(n)) * Pol(toruns(k)))) }

Formula

A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, 1) = n.
A(n, 3) = A001196(n).
A(n, 7) = A097254(n+1).
A(n, n) = A355654(n).

A356353 Numbers k such that A356352(k) <> 1.

Original entry on oeis.org

0, 3, 7, 12, 15, 31, 48, 51, 56, 60, 63, 127, 192, 195, 204, 207, 240, 243, 252, 255, 448, 455, 504, 511, 768, 771, 780, 783, 816, 819, 828, 831, 960, 963, 972, 975, 992, 1008, 1011, 1020, 1023, 2047, 3072, 3075, 3084, 3087, 3120, 3123, 3132, 3135, 3264, 3267
Offset: 1

Views

Author

Rémy Sigrist, Oct 15 2022

Keywords

Comments

Also, numbers whose binary expansions are juxtapositions of constant blocks of size g > 1.
A001196 and A097254 are subsequences.
There are A178472(k) terms with binary length k.

Examples

			The first terms, alongside their binary expansions and A356352(a(n)), are:
  n   a(n)  bin(a(n))   A356352(a(n))
  --  ----  ----------  -------------
   1     0           0              0
   2     3          11              2
   3     7         111              3
   4    12        1100              2
   5    15        1111              4
   6    31       11111              5
   7    48      110000              2
   8    51      110011              2
   9    56      111000              3
  10    60      111100              2
  11    63      111111              6
  12   127     1111111              7
  13   192    11000000              2
  14   195    11000011              2
  15   204    11001100              2
  16   207    11001111              2
		

Crossrefs

Programs

  • PARI
    is(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); gcd(r)!=1 }
    
  • PARI
    See Links section.
    
  • Python
    from math import gcd
    from itertools import groupby
    def ok(n):
        if n == 0: return True # by convention of A356352
        return gcd(*(len(list(g)) for k, g in groupby(bin(n)[2:]))) != 1
    print([k for k in range(3268) if ok(k)]) # Michael S. Branicky, Oct 15 2022
Showing 1-4 of 4 results.