(Translated by https://www.hiragana.jp/)
A309523 - OEIS
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309523 Start with a(1) = 1 and apply certain patterns of operations on a(n-1) to obtain a(n) as described in comments. 1
1, 7, 8, 2, 16, 4, 5, 17, 10, 34, 35, 11, 70, 22, 23, 71, 46, 142, 143, 47, 286, 94, 95, 287, 190, 574, 575, 191, 1150, 382, 383, 1151, 766, 2302, 2303, 767, 4606, 1534, 1535, 4607, 3070, 9214, 9215, 3071, 18430, 6142, 6143, 18431, 12286, 36862 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(2) = 7 is obtained from a(1) = 1 by (((1) +1) *3) +1. We abbreviate this to the operation pattern "+1 *3 +1". The 8 patterns for a(3..10), a(11..18) etc. are:
+1
+1 /3 -1
+1 *3 *2 -2
-1 /3 -1
+1
+1 *3 -1
+1 /3 *2 -2
+1 *3 +1
A308709 uses similar, but simpler patterns in blocks of 4 (cf. the example, below). A308709 contains the set {2^k | k>=0} union {3*2^k | k>=0}, so all terms are different. This sequence contains the terms {6*A308709 - 2} union {6*A308709 - 1}, therefore all terms are also different.
LINKS
FORMULA
From Colin Barker, Aug 06 2019: (Start)
G.f.: x*(1 + 6*x + 2*x^2 + 15*x^4 - 18*x^5 + 15*x^6 - 10*x^8 + 12*x^9 - 14*x^10) / ((1 - x)*(1 + x^2)*(1 - 2*x^4)*(1 + 2*x^4)).
a(n) = a(n-1) - a(n-2) + a(n-3) + 4*a(n-8) - 4*a(n-9) + 4*a(n-10) - 4*a(n-11) for n>11.
(End)
EXAMPLE
A308709 | this sequence
| 1
| 7 +1 *3 +1
| 8 +1
| 2 +1 /3 -1
3 | 16 +1 *3 *2 -2
1 /3 | 4 -1 /3 -1
| 5 +1
| 17 +1 *3 -1
2 *2 | 10 +1 /3 *2 -2
6 *3 | 34 +1 *3 +1
| 35 +1
| 11 +1 /3 -1
12 *2 | 70 +1 *3 *2 -2
4 /3 | 22 -1 /3 -1
| 23 +1
| 71 +1 *3 -1
8 *2 | 46 +1 /3 *2 -2
24 *3 | 142 +1 *3 +1
| 143 +1
MATHEMATICA
LinearRecurrence[{1, -1, 1, 0, 0, 0, 0, 4, -4, 4, -4}, {1, 7, 8, 2, 16, 4, 5, 17, 10, 34, 35}, 50]
PROG
(PARI) Vec(x*(1 + 6*x + 2*x^2 + 15*x^4 - 18*x^5 + 15*x^6 - 10*x^8 + 12*x^9 - 14*x^10) / ((1 - x)*(1 + x^2)*(1 - 2*x^4)*(1 + 2*x^4)) + O(x^40)) \\ Colin Barker, Aug 06 2019
(Perl) use integer;
my @a; my $n = 1; $a[$n ++] = 1;
$a[$n ++] = (($a[$n-1] +1) *3) +1; # 7
while ($n < 50) {
$a[$n ++] = (($a[$n-1] +1) ); # 8
$a[$n ++] = (($a[$n-1] +1) /3) -1; # 2
$a[$n ++] = (($a[$n-1] +1) *3) *2 -2; # 16
$a[$n ++] = (($a[$n-1] -1) /3) -1; # 4
$a[$n ++] = (($a[$n-1] +1) ); # 5
$a[$n ++] = (($a[$n-1] +1) *3) -1; # 17
$a[$n ++] = (($a[$n-1] +1) /3) *2 -2; # 10
$a[$n ++] = (($a[$n-1] +1) *3) +1; # 34
} # while
shift(@a); # remove $a[0]
print join(", ", @a) . "\n"; # Georg Fischer, Aug 07 2019
(Python 3)
def A309523():
k, j, a = 0, 0, 1
def b(a): return a + 1
def c(a): return a + 2
def d(a): return a - 1
def e(a): return a - 2
def f(a): return a << 1
def g(a): return a * 3
def h(a): return a // 3
O = [c, g, e, b, b, h, d, b, g, f, e, c, h, e, b, b, g, d, b, h, f, e]
L = [3, 1, 3, 4]
while True:
yield(a)
for _ in range(L[j]):
a = O[k](a)
k += 1; k %= 22
j += 1; j %= 4
a = A309523()
print([next(a) for _ in range(50)]) # Peter Luschny, Aug 06 2019
CROSSREFS
Cf. A308709.
Sequence in context: A342486 A245758 A266566 * A153622 A257576 A064207
KEYWORD
nonn,easy
AUTHOR
Georg Fischer, Aug 06 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 23 21:32 EDT 2024. Contains 374572 sequences. (Running on oeis4.)