|
|
A371054
|
|
Numbers whose ternary representation consists of a run of 1's, then a run of 0's, then a run of 2's.
|
|
1
|
|
|
11, 29, 35, 38, 83, 89, 107, 110, 116, 119, 245, 251, 269, 323, 326, 332, 350, 353, 359, 362, 731, 737, 755, 809, 971, 974, 980, 998, 1052, 1055, 1061, 1079, 1082, 1088, 1091, 2189, 2195, 2213, 2267, 2429, 2915, 2918, 2924, 2942, 2996, 3158, 3161, 3167, 3185
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(n) == 2 (mod 3) for all n.
|
|
LINKS
|
|
|
MATHEMATICA
|
Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {1, 0, 2}} &,
Range[2, 4000, 3]], #[[2]] &]] (* this sequence *)
ToExpression[Map[IntegerString[#, 3] &, %]] (* A371055 *)
|
|
PROG
|
(Python)
from itertools import count, islice
def A371054_gen(): # generator of terms
return (3**(l-a)*(3**a-1>>1)+3**b-1 for l in count(3) for a in range(1, l-1) for b in range(1, l-a))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|