(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

%I #23 Jun 04 2021 10:51:49

%S 1,7,8,2,16,4,5,17,10,34,35,11,70,22,23,71,46,142,143,47,286,94,95,

%T 287,190,574,575,191,1150,382,383,1151,766,2302,2303,767,4606,1534,

%U 1535,4607,3070,9214,9215,3071,18430,6142,6143,18431,12286,36862

%N Start with a(1) = 1 and apply certain patterns of operations on a(n-1) to obtain a(n) as described in comments.

%C 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:

%C +1

%C +1 /3 -1

%C +1 *3 *2 -2

%C -1 /3 -1

%C +1

%C +1 *3 -1

%C +1 /3 *2 -2

%C +1 *3 +1

%C 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.

%H Colin Barker, <a href="/A309523/b309523.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,0,0,0,0,4,-4,4,-4).

%F From _Colin Barker_, Aug 06 2019: (Start)

%F 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)).

%F 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.

%F (End)

%e A308709 | this sequence

%e | 1

%e | 7 +1 *3 +1

%e | 8 +1

%e | 2 +1 /3 -1

%e 3 | 16 +1 *3 *2 -2

%e 1 /3 | 4 -1 /3 -1

%e | 5 +1

%e | 17 +1 *3 -1

%e 2 *2 | 10 +1 /3 *2 -2

%e 6 *3 | 34 +1 *3 +1

%e | 35 +1

%e | 11 +1 /3 -1

%e 12 *2 | 70 +1 *3 *2 -2

%e 4 /3 | 22 -1 /3 -1

%e | 23 +1

%e | 71 +1 *3 -1

%e 8 *2 | 46 +1 /3 *2 -2

%e 24 *3 | 142 +1 *3 +1

%e | 143 +1

%t LinearRecurrence[{1, -1, 1, 0, 0, 0, 0, 4, -4, 4, -4},{1, 7, 8, 2, 16, 4, 5, 17, 10, 34, 35}, 50]

%o (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

%o (Perl) use integer;

%o my @a; my $n = 1; $a[$n ++] = 1;

%o $a[$n ++] = (($a[$n-1] +1) *3) +1; # 7

%o while ($n < 50) {

%o $a[$n ++] = (($a[$n-1] +1) ); # 8

%o $a[$n ++] = (($a[$n-1] +1) /3) -1; # 2

%o $a[$n ++] = (($a[$n-1] +1) *3) *2 -2; # 16

%o $a[$n ++] = (($a[$n-1] -1) /3) -1; # 4

%o $a[$n ++] = (($a[$n-1] +1) ); # 5

%o $a[$n ++] = (($a[$n-1] +1) *3) -1; # 17

%o $a[$n ++] = (($a[$n-1] +1) /3) *2 -2; # 10

%o $a[$n ++] = (($a[$n-1] +1) *3) +1; # 34

%o } # while

%o shift(@a); # remove $a[0]

%o print join(", ", @a) . "\n"; # _Georg Fischer_, Aug 07 2019

%o (Python 3)

%o def A309523():

%o k, j, a = 0, 0, 1

%o def b(a): return a + 1

%o def c(a): return a + 2

%o def d(a): return a - 1

%o def e(a): return a - 2

%o def f(a): return a << 1

%o def g(a): return a * 3

%o def h(a): return a // 3

%o O = [c,g,e,b,b,h,d,b,g,f,e,c,h,e,b,b,g,d,b,h,f,e]

%o L = [3,1,3,4]

%o while True:

%o yield(a)

%o for _ in range(L[j]):

%o a = O[k](a)

%o k += 1; k %= 22

%o j += 1; j %= 4

%o a = A309523()

%o print([next(a) for _ in range(50)]) # _Peter Luschny_, Aug 06 2019

%Y Cf. A308709.

%K nonn,easy

%O 1,2

%A _Georg Fischer_, Aug 06 2019

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 August 27 03:11 EDT 2024. Contains 375462 sequences. (Running on oeis4.)