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.

A367090 Numbers that cannot be written as a sum of distinct powers of 3 and distinct powers of 4.

Original entry on oeis.org

62, 63, 143, 144, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480
Offset: 1

Views

Author

M. F. Hasler, Nov 08 2023

Keywords

Comments

These numbers come mostly in chunks/runs of length 2 or 36 or 23 (first occurring as length of the 7th run starting with 706) or later 14 (length of a run starting at 6768), 1081 (length of a run starting with 15303), 20 (length of a run starting with 21186), ...
The first isolated terms are a(2701) = 25595 and a(2702) = 25774.
This set exhibits an interesting self-similar, pseudo-symmetric structure. This is due to the following
Proposition: Let d(n) = (3^r(n)-1)/2 + (4^s(n)-1)/3, where r and s are exponents such that 4^(s(n)-1) <= 3^(r(n)-1) < 3^r(n) < 4^s(n), r(0) = s(0) = 1 being the only case with equality. Then any x <= d(n) is in this sequence iff d(n) - x is in the sequence.
The study of this set is certainly useful in view of a proof of Erdős's conjecture mentioned in A327621, namely, the positive density of A005836 + A000695 (set-wise sum). This is obviously equivalent to an asymptotic density strictly smaller than 1 of the present sequence which is the complement.

Examples

			0 is the empty sum, 1 = 3^0 = 4^0, 2 = 3^0 + 4^0 (*), 3 = 3^1, 4 = 4^1, 5 = 4^0 + 4^1, 6 = 3^0 + 4^0 + 4^1 (*), ..., so these numbers are not in this sequence.
After 61 = 3^0 + 3^1 + 3^2 + 3^3 + 4^0 + 4^1 + 4^2, the next larger number that is such a sum of powers is 64 = 4^3, which creates the first gap of [62, 63], first terms of this sequence.
		

Crossrefs

Cf. A000244 (powers of 3), A000302 (powers of 4).
Cf. A005836 and A000695 (sums of distinct powers of 3 and of 4).
Cf. A327621.

Programs

  • PARI
    S34_upto(N)={my( p(N,b)=[b^k|k<-[0..logint(N,b)]] , S=[0] , i); for(b=3,4,
    foreach(p(N,b),x, S = setunion(S, [x+y| y<-S[1 .. if( S[#S]+x < N, -1,
      i=setsearch(S,N-x,1), i-1, setsearch(S,N-x)) ]]))); S}
    A367090_upto(N) = setminus([1..N], S34_upto(N)) \\ not very efficient...

Formula

Complement of A005836 + A000695 = { x+y ; x in A005836 and y in A000695 }.

A367083 List of powers of 3 and powers of 4, in increasing order, starting with a(0) = 3^0 = 4^0 = 1.

Original entry on oeis.org

1, 3, 4, 9, 16, 27, 64, 81, 243, 256, 729, 1024, 2187, 4096, 6561, 16384, 19683, 59049, 65536, 177147, 262144, 531441, 1048576, 1594323, 4194304, 4782969, 14348907, 16777216, 43046721, 67108864, 129140163, 268435456, 387420489, 1073741824, 1162261467, 3486784401, 4294967296, 10460353203, 17179869184
Offset: 0

Views

Author

M. F. Hasler, Nov 03 2023

Keywords

Comments

The sequence mostly alternates between powers of 3 (odd terms) and powers of 4 (even terms), but after either 3 or 4 powers of 4, separated by powers of 3, there occur two consecutive powers of 3 in a row.
Sequence A367084 lists the indices n of odd terms immediately followed by another odd term. We can split the sequence of terms > 1 in groups of 7 or 9 consecutive terms (a(A367084(n)+1 .. A367084(n+1)) such that each group starts and ends with an odd term. The sequence of the group lengths will be 7, 9, 9, 9, 9, 7, 9, 9, 9, 9, 9, 7, etc. There will always be 4 or 5 consecutive 9's separated by a single 7. The run lengths of the 9's are (4, 5, 4, 5, 4, 5, 4, ...) but this pattern is also slightly irregular, with two consecutive 5's occurring after every 24 (very rarely fewer) elements.
We think these patterns are important for the study of Erdős's conjecture of a positive density of Sum(Pow({3,4})) mentioned in A327621.

Crossrefs

Cf. A000244 (powers of 3), A000302 (powers of 4).

Programs

  • Mathematica
    With[{max=2*10^10},Union[3^Range[0,Log[3,max]],4^Range[0,Log[4,max]]]] (* Paul F. Marrero Romero, Nov 14 2023 *)
  • PARI
    upto(N)={my(p(b)=[b^k|k<-[0..logint(N,b)]]);setunion(p(3), p(4))}
    
  • Python
    from itertools import islice
    def A367083_gen(): # generator of terms
        yield 1
        a, b = 1, 4
        while True:
            while (a:=a*3)A367083_list = list(islice(A367083_gen(),30)) # Chai Wah Wu, Nov 08 2023

Formula

Union of A000244 and A000302.

A367084 Indices k such that A367083(k) and A367083(k+1) are both odd.

Original entry on oeis.org

0, 7, 16, 25, 34, 43, 50, 59, 68, 77, 86, 95, 102, 111, 120, 129, 138, 145, 154, 163, 172, 181, 190, 197, 206, 215, 224, 233, 240, 249, 258, 267, 276, 285, 292, 301, 310, 319, 328, 335, 344, 353, 362, 371, 380, 387, 396, 405, 414, 423, 430, 439, 448, 457, 466, 475, 482, 491, 500
Offset: 0

Views

Author

M. F. Hasler, Nov 03 2023

Keywords

Comments

First differences are either 7 (in isolated positions) or 9 (always 4 or 5 times consecutively in a row). It is interesting to study these run lengths, see A367083 for further information.

Crossrefs

Programs

  • PARI
    A367084_upto(N) = [n|n<-A=A367083_upto(N), A[n+1]==Mod(A[n],2)]
    
  • Python
    from itertools import islice
    def A367084_gen(): # generator of terms
        a, b, c = 1, 4, -1
        while True:
            while (a:=a*3)A367084_list = list(islice(A367084_gen(),30)) # Chai Wah Wu, Nov 08 2023

A367086 Exponents k > 0 such that the interval [4^(k-1), 4^k] contains two powers of 3.

Original entry on oeis.org

1, 4, 8, 12, 16, 20, 23, 27, 31, 35, 39, 43, 46, 50, 54, 58, 62, 65, 69, 73, 77, 81, 85, 88, 92, 96, 100, 104, 107, 111, 115, 119, 123, 127, 130, 134, 138, 142, 146, 149, 153, 157, 161, 165, 169, 172, 176, 180, 184, 188, 191, 195, 199, 203, 207, 211, 214, 218, 222, 226, 230, 233, 237, 241
Offset: 0

Views

Author

M. F. Hasler, Nov 03 2023

Keywords

Comments

This is a list or set of numbers but at the same time a function of n related to other sequences A367083 - A367085 that all use the same index n starting at offset 0, which explains why this sequence also starts at offset 0.
The list of powers of 3 and powers of 4 by increasing size is A367083 = (1; 3^1, 4^1, 3^2, 4^2, 3^3, 4^3, 3^4; 3^5, 4^4, 3^6, 4^5, 3^7, 4^6, 3^8, 4^7, 3^9; 3^10, ...). That list can be split into groups (3^r, 4^s, ..., 3^r') of either 4+3 = 7 or 5+4 = 9 terms which start and end with a power of three. Otherwise said, the end of one group and the start of the next group are two consecutive powers of 3 that lie between two consecutive powers of 4.
This sequence lists the exponent of the first power of 4 in each group: these are exactly the exponents k of powers of 4 such that there are two powers of 3 in the interval [4^(k-1), 4^k].
The first differences, D = (3, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 3, ...) are directly related to those of A367084 and A367085, viz, D(n) = (A367084(n+1)-A367084(n)-1)/2 = A367085(n+1)-A367085(n)-1. The run lengths of the '4's are (4, 5, 4, 5, ...) with two consecutive '5's every 24 +- 1 terms.

Examples

			The smallest power 4^s such that the interval [4^(s-1), 4^s] contains two powers of 3 is 4^1, i.e., s = 1, where [4^0, 4^1] contains 3^0 and 3^1. Hence a(0) = 1. (This is also the exponent of the smallest power of 4 in the first group of the form (3^r, 4^s, ..., 3^r') in A367083, namely: (3^1, 4^1, 3^2, 4^2, 3^3, 4^3, 3^4).)
The next larger power of 4 with this property is 4^4, hence a(1) = 4, where [4^3, 4^4] contains 3^4 and 3^5. This is also the least exponent of a power of 4 in the second group (3^5, 4^4, 3^6, 4^5, ..., 3^9), which is marked on the left in the table below.
.
    Numbers of the forms
         3^r      4^s
      ------   ------
         ...
    |              16
    |     27 __________    the interval
    |              64  |    [4^3, 4^4]
    \____ 81           |   includes two
    /    243           |   powers of 3,
  2 |        ____ 256 _|  so 4 is a term
  n |    729             of this sequence
  d |            1024
    |   2187
  g |            4096
  r |   6561 __________    the interval
  p |           16384  |    [4^7, 4^8]
    \_ 19683           |   includes two
    /  59049           |   powers of 3,
    |        __ 65536 _|  so 8 is a term
    | 177147             of this sequence
    |          262144
    | 531441
                  ...
		

Crossrefs

Cf. A000244 (powers of 3), A000302 (powers of 4).

Programs

  • PARI
    A367086_upto(N)={my(r=1, s=1, L3=log(3), L4=log(4), A=List(s)); until(r>=N, listput(A, s-=1+r-r+=((r+4)*L3 > (s+3)*L4)+4)); Vec(A)}
    
  • Python
    from itertools import islice
    def A367086_gen(): # generator of terms
        a, b, c, i = 1, 4, -1, 1
        while True:
            while (a:=a*3)A367086_list = list(islice(A367086_gen(),30)) # Chai Wah Wu, Nov 18 2023

Formula

a(n) = A235127( A367083( A367084(n)+2 )), where A235127 is the 4-valuation.
a(n) = 1 + floor(n/log_3(4/3)) = 1 + floor(n/(log_3(4) - 1)).
Showing 1-4 of 4 results.