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
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.
-
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...
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
-
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 *)
-
upto(N)={my(p(b)=[b^k|k<-[0..logint(N,b)]]);setunion(p(3), p(4))}
-
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
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
-
A367084_upto(N) = [n|n<-A=A367083_upto(N), A[n+1]==Mod(A[n],2)]
-
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
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
...
-
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)}
-
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
Showing 1-4 of 4 results.
Comments