A048435
Take the first n numbers written in base 3, concatenate them, then convert from base 3 to base 10.
Original entry on oeis.org
1, 5, 48, 436, 3929, 35367, 318310, 2864798, 77349555, 2088437995, 56387825876, 1522471298664, 41106725063941, 1109881576726421, 29966802571613382, 809103669433561330, 21845799074706155927, 589836575017066210047, 15925587525460787671288, 429990863187441267124796
Offset: 1
a(6): (1)(2)(10)(11)(12)(20) = 1210111220_3 = 35367.
Concatenation of first n numbers in other bases: 2:
A047778, 3: this sequence, 4:
A048436, 5:
A048437, 6:
A048438, 7:
A048439, 8:
A048440, 9:
A048441, 10:
A007908, 11:
A048442, 12:
A048443, 13:
A048444, 14:
A048445, 15:
A048446, 16:
A048447.
-
[n eq 1 select 1 else Self(n-1)*3^(1+Ilog(3, n))+n: n in [1..20]]; // Vincenzo Librandi, Dec 30 2012
-
If[STARTPOINT==1,n={},n=Flatten[IntegerDigits[Range[STARTPOINT-1],3]]]; Table[AppendTo[n,IntegerDigits[w,3]];n=Flatten[n];FromDigits[n,3],{w,STARTPOINT,ENDPOINT}] (* Dylan Hamilton, Aug 09-04 2010 *)
f[n_]:= FromDigits[Flatten@IntegerDigits[Range@n, 3], 3]; Array[f, 20] (* Vincenzo Librandi, Dec 30 2012 *)
A360502
Concatenate the ternary strings for 1,2,...,n.
Original entry on oeis.org
1, 12, 1210, 121011, 12101112, 1210111220, 121011122021, 12101112202122, 12101112202122100, 12101112202122100101, 12101112202122100101102, 12101112202122100101102110, 12101112202122100101102110111, 12101112202122100101102110111112, 12101112202122100101102110111112120
Offset: 1
a(4): concatenate 1, 2, 10, 11, getting 121011.
This is the ternary analog of
A007908.
-
a:= proc(n) option remember; `if`(n=0, 0, (l-> parse(cat(
a(n-1), seq(l[-i], i=1..nops(l)))))(convert(n, base, 3)))
end:
seq(a(n), n=1..15); # Alois P. Heinz, Feb 17 2023
-
nn = 15; s = IntegerDigits[Range[nn], 3]; Array[FromDigits[Join @@ s[[1 ;; #]]] &, nn] (* Michael De Vlieger, Apr 19 2023 *)
-
from sympy.ntheory import digits
def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(1, n+1)))
print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 18 2023
-
# faster version for initial segment of sequence
from sympy.ntheory import digits
from itertools import count, islice
def agen(s=""): yield from (int(s:=s+"".join(map(str, digits(n, 3)[1:]))) for n in count(1))
print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 18 2023
A360504
Concatenate the ternary strings for 1,2,...,n-1, n, n-1, ..., 2,1.
Original entry on oeis.org
1, 121, 121021, 1210111021, 12101112111021, 121011122012111021, 1210111220212012111021, 12101112202122212012111021, 1210111220212210022212012111021, 1210111220212210010110022212012111021, 1210111220212210010110210110022212012111021, 1210111220212210010110211010210110022212012111021
Offset: 1
To get a(3) we concatenate 1, 2, 10, 2, and 1, getting 121021.
This is the ternary analog of
A173426.
-
t:= n-> (l-> parse(cat(seq(l[-i], i=1..nops(l)))))(convert(n, base, 3)):
a:= n-> parse(cat(map(t, [$1..n, n-i$i=1..n-1])[])):
seq(a(n), n=1..12); # Alois P. Heinz, Feb 17 2023
-
Table[FromDigits[Flatten[Join[IntegerDigits[#,3]&/@Range[n],IntegerDigits[#,3]&/@ Range[ n-1,1,-1]]]],{n,20}] (* Harvey P. Dale, Oct 01 2023 *)
-
from sympy.ntheory import digits
def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in list(range(1, n+1))+list(range(n-1, 0, -1))))
print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 18 2023
-
# faster version for initial segment of sequence
from sympy.ntheory import digits
from itertools import count, islice
def agen(): # generator of terms
sf, sr = "", ""
for n in count(1):
sn = "".join(map(str, digits(n, 3)[1:]))
sf += sn
yield int(sf + sr)
sr = sn + sr
print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 18 2023
A360506
Read A360505(n) as if it were a base-3 string and write it in base 10.
Original entry on oeis.org
1, 7, 34, 358, 4003, 43369, 456712, 4708240, 47754961, 1339156591, 39693785002, 1169411930926, 34213667699203, 995038950807565, 28790341783585180, 829295063367580492, 23793774263808446005, 680307709052882601259, 19390954850541496025998
Offset: 1
A360505(4) = 111021 and 111021_3 = 358_10 = a(4).
-
a(n) = fromdigits(concat([digits(k, 3) | k <- Vecrev([1..n])]), 3) \\ Rémy Sigrist, Feb 18 2023
-
from sympy.ntheory import digits
def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(n, 0, -1)), 3)
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Feb 19 2023
-
# faster version for initial segment of sequence
from sympy.ntheory import digits
from itertools import count, islice
def agen(s=""): yield from (int(s:="".join(map(str, digits(n, 3)[1:]))+s, 3) for n in count(1))
print(list(islice(agen(), 20))) # Michael S. Branicky, Feb 19 2023
-
from itertools import count, islice
def A360506_gen(): # generator of terms
a, b, c = 3, 1, 0
for i in count(1):
if i >= a:
a *= 3
c += i*b
yield c
b *= a
A360506_list = list(islice(A360506_gen(),30)) # Chai Wah Wu, Nov 08 2023
A359148
1, together with numbers k such that A173426(k) is prime.
Original entry on oeis.org
A360507
Numbers k such that A360506(k) is prime.
Original entry on oeis.org
2, 5, 13, 57, 109, 638, 3069
Offset: 1
A360506(5) = 4003 is prime, so 5 is a term.
Showing 1-6 of 6 results.
Comments