cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 14 results. Next

A086893 a(n) is the index of F(n+1) at the unique occurrence of the ordered pair of reversed consecutive terms (F(n+1),F(n)) in Stern's diatomic sequence A002487, where F(k) denotes the k-th term of the Fibonacci sequence A000045.

Original entry on oeis.org

1, 3, 5, 13, 21, 53, 85, 213, 341, 853, 1365, 3413, 5461, 13653, 21845, 54613, 87381, 218453, 349525, 873813, 1398101, 3495253, 5592405, 13981013, 22369621, 55924053, 89478485, 223696213, 357913941, 894784853, 1431655765, 3579139413
Offset: 1

Views

Author

John W. Layman, Sep 18 2003

Keywords

Comments

If the Fibonacci pairs are kept in the natural order (F(n),F(n+1)), it appears that the first term of the pair occurs in A002487 at the index given by A061547(n).
Equals row sums of triangle A177954. - Gary W. Adamson, May 15 2010
Starting at n=3, begin subtracting from (2^(n-1)-1)/2^(n-1): 3/4 - 1/2 = 1/4 with 1+4=5=a(3); 7/8 - 1/4 = 5/8 with 5+8=13=a(4); 15/16 - 5/8 = 5/16 with 5+16=21= a(5); 31/32 - 5/16 = 21/32 with 21+32=53=a(6); 63/64 - 21/32 = 21/64 with 21+64=85=a(7) and so on. For n odd in the first fraction (2^(n-1)-1)/2^(n-1), the result approaches 1/3, and for n even in the first fraction, the result approaches 2/3. - J. M. Bergot, May 08 2015
Also, the decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 678", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. See A283641. - Robert Price, Mar 12 2017

Examples

			A002487 begins 0,1,1,2,1,3,2,... with offset 0. Thus a(1)=1 since (F(2),F(1)) = (1,1) occurs at term 1 of A002487. Similarly, a(2)=3 and a(3)=5, since (F(3),F(2))=(2,1) occurs at term 3 and (F(4),F(3))=(3,2) at term 5 of A002487.
		

Crossrefs

Interleaving of A002450\{0} and A072197.
Positive terms of A096773 in ascending order.
Partial sums of A158302.

Programs

  • Magma
    [2^(n-1)*(3-(-1)^n/3)-1/3: n in [0..35]]; // Vincenzo Librandi, May 09 2015
    
  • Mathematica
    f[n_] := Module[{a = 1, b = 0, m = n}, While[m > 0, If[OddQ@ m, b = a + b, a = a + b]; m = Floor[m/2]]; b]; a = Table[f[n], {n, 0, 10^6}]; b = Reverse /@ Partition[Map[Fibonacci, Range[Ceiling@ Log[GoldenRatio, Max@ a] + 1]], 2, 1]; Map[If[Length@ # > 0, #[[1, 1]] - 1, 0] &@ SequencePosition[a, #] &, b] (* Michael De Vlieger, Mar 15 2017, Version 10.1, after Jean-François Alcover at A002487 *)
  • PARI
    a(n)=if(n%2,2^(n+1),2^(n+1)+2^(n-1))\3 \\ Charles R Greathouse IV, May 08 2015
    
  • Python
    def A086893(n): return (1<Chai Wah Wu, Apr 29 2024

Formula

It appears that a(n)=(4^((n+1)/2)-1)/3 if n is odd and a(n)=(a(n-1)+a(n+1))/2 if n is even.
G.f.: (1+2*x-2*x^2)/((1-x)*(1-4*x^2)); a(n) = 2^(n-1)(3-(-1)^n/3)-1/3 (offset 0); a(n) = Sum{k=0..n+1, 4^floor(k/2)/2} (offset 0); a(2n) = A002450(n+1) (offset 0); a(2n+1) = A072197(n) (offset 0). - Paul Barry, May 21 2004
a(n+2) = 4*a(n) + 1, a(1) = 1, a(2) = 3, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n+1) = a(n) + A158302(n), a(1) = 1, n > 0. - Yosu Yurramendi, Mar 07 2017

Extensions

More terms from Paul Barry, May 21 2004

A371094 a(n) = m*(2^e) + ((4^e)-1)/3, where m = 3n+1, and e is the 2-adic valuation of m.

Original entry on oeis.org

1, 21, 7, 21, 13, 341, 19, 45, 25, 117, 31, 69, 37, 341, 43, 93, 49, 213, 55, 117, 61, 5461, 67, 141, 73, 309, 79, 165, 85, 725, 91, 189, 97, 405, 103, 213, 109, 1877, 115, 237, 121, 501, 127, 261, 133, 1109, 139, 285, 145, 597, 151, 309, 157, 5461, 163, 333, 169, 693, 175, 357, 181, 1493, 187, 381, 193, 789, 199
Offset: 0

Views

Author

Antti Karttunen (proposed by Ali Sada), Apr 19 2024

Keywords

Comments

Construction: take the binary expansion of 3n+1 (A016777(n)), and substitute "01" for all trailing 0-bits that follow after its odd part (= A067745(1+n)), of which there are A371093(n) in total. See the examples.

Examples

			For n=1, 3*n+1 = 4, "100" in binary, when we substitute 01's for the two trailing 0's, we obtain 21, "10101" in binary, therefore a(1) = 21.
For n=6, 3*6+1 = 19, "10011" in binary, and there are no trailing 0's, and no changes, therefore a(6) = 19.
For n=7, 3*7+1 = 22, "10110" in binary, with one trailing 0, which when replaced with 01 gives us 45, "101101" in binary, therefore a(7) = 45.
For n=229, there are e=4 trailing bit expansions 0 -> 01,
  3n+1 = binary  101011  0 0 0 0
  a(n) = binary  101011 01010101
		

Crossrefs

Cf. A016921, A372351 (even and odd bisection), A372290 (numbers occurring in the latter).
Cf. also A302338.

Programs

  • Mathematica
    Array[#2*(2^#3) + ((4^#3) - 1)/3 & @@ {#1, #2, IntegerExponent[#2, 2]} & @@ {#, 3 #1 + 1} &, 67, 0] (* Michael De Vlieger, Apr 19 2024 *)
  • PARI
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    
  • Python
    def A371094(n): return ((m:=3*n+1)<<(e:=(~m & m-1).bit_length()))+((1<<(e<<1))-1)//3 # Chai Wah Wu, Apr 28 2024

Formula

a(n) = A372289(A016777(n)).
a(2n) = A016777(2n) = A016921(n).

A257852 Array A read by upward antidiagonals in which the entry A(n,k) in row n and column k is defined by A(n,k) = (2^n*(6*k - 3 - 2*(-1)^n) - 1)/3, n,k >= 1.

Original entry on oeis.org

3, 1, 7, 13, 9, 11, 5, 29, 17, 15, 53, 37, 45, 25, 19, 21, 117, 69, 61, 33, 23, 213, 149, 181, 101, 77, 41, 27, 85, 469, 277, 245, 133, 93, 49, 31, 853, 597, 725, 405, 309, 165, 109, 57, 35, 341, 1877, 1109, 981, 533, 373, 197, 125, 65, 39
Offset: 1

Views

Author

L. Edson Jeffery, Jul 12 2015

Keywords

Comments

Sequence is a permutation of the odd natural numbers.
Let N_1 denote the set of odd natural numbers, and let |y|_2 denote 2-adic valuation of y. Define the map F : N_1 -> N_1 by F(x) = (3*x + 1)/2^|3*x+1|_2 (cf. A075677). Then row n of A is the set of all x in N_1 for which |3*x + 1|_2 = A371093(x) = n. Hence F(A(n,k)) = 6*k - 3 - 2*(-1)^n.

Examples

			From _Ruud H.G. van Tol_, Oct 17 2023, corrected and extended by _Antti Karttunen_, Apr 18 2024: (Start)
Array A begins:
n\k|   1|   2|   3|   4|   5|   6|   7|   8| ...
---+---------------------------------------------
1  |   3,   7,  11,  15,  19,  23,  27,  31, ...
2  |   1,   9,  17,  25,  33,  41,  49,  57, ...
3  |  13,  29,  45,  61,  77,  93, 109, 125, ...
4  |   5,  37,  69, 101, 133, 165, 197, 229, ...
5  |  53, 117, 181, 245, 309, 373, 437, 501, ...
6  |  21, 149, 277, 405, 533, 661, 789, 917, ...
... (End)
		

Crossrefs

Cf. A006370, A075677, A096773 (after its initial 0, column 1 of this array).
Cf. A004767, A017077, A082285, A238477 (rows 1-4).
Cf. A371092, A371093 (column and row indices for odd numbers).

Programs

  • Mathematica
    (* Array: *)
    Grid[Table[(2^n*(6*k - 3 - 2*(-1)^n) - 1)/3, {n, 10}, {k, 10}]]
    (* Array antidiagonals flattened: *)
    Flatten[Table[(2^(n - k + 1)*(6*k - 3 - 2*(-1)^(n - k + 1)) - 1)/ 3, {n, 10}, {k, n}]]
  • PARI
    up_to = 105;
    A257852sq(n,k) = ((2^n * (6*k - 3 - 2*(-1)^n) - 1)/3);
    A257852list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A257852sq((a-(col-1)),col))); (v); };
    v257852 = A257852list(up_to);
    A257852(n) = v257852[n]; \\ Antti Karttunen, Apr 18 2024

Formula

From Ruud H.G. van Tol, Oct 17 2023: (Start)
A(n,k+1) = A(n,k) + 2^(n+1).
A(n+2,k) = A(n,k)*4 + 1.
A(1,k) = A004767(k-1).
A(2,k) = A017077(k-1).
A(3,k) = A082285(k-1).
A(4,k) = A238477(k). (End)
For all odd positive numbers n, A(A371093(n), A371092(n)) = n. - Antti Karttunen, Apr 24 2024

A162912 Denominators of drib tree fractions, where drib is the bit-reversal permutation tree of the Bird tree.

Original entry on oeis.org

1, 2, 1, 3, 1, 3, 2, 5, 2, 4, 3, 4, 1, 5, 3, 8, 3, 7, 5, 5, 1, 7, 4, 7, 3, 5, 4, 7, 2, 8, 5, 13, 5, 11, 8, 9, 2, 12, 7, 9, 4, 6, 5, 10, 3, 11, 7, 11, 4, 10, 7, 6, 1, 9, 5, 12, 5, 9, 7, 11, 3, 13, 8, 21, 8, 18, 13, 14, 3, 19, 11, 16, 7, 11, 9, 17, 5, 19, 12, 14, 5, 13, 9, 7, 1, 11, 6, 17, 7, 13, 10, 15
Offset: 1

Views

Author

Ralf Hinze (ralf.hinze(AT)comlab.ox.ac.uk), Aug 05 2009

Keywords

Comments

The drib tree is an infinite binary tree labeled with rational numbers. It is generated by the following iterative process: start with the rational 1; for the left subtree increment and then take the reciprocal of the current rational; for the right subtree interchange the order of the two steps: take the reciprocal and then increment. Like the Stern-Brocot and the Bird tree, the drib tree enumerates the positive rationals: A162911(n)/A162912(n).
From Yosu Yurramendi, Jul 11 2014: (Start)
If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
2, 1,
3, 1, 3,2,
5, 2, 4,3,4,1, 5,3,
8, 3, 7,5,5,1, 7,4,7,3,5,4, 7,2, 8,5,
13,5,11,8,9,2,12,7,9,4,6,5,10,3,11,7,11,4,10,7,6,1,9,5,12,5,9,7,11,3,13,8,
then the sum of the m-th row is 3^m (m = 0,1,2,), and each column k is a Fibonacci sequence (a(2^(m+2)+k) = a(2^(m+1)+k) + a(2^m+k), m = 0,1,2,..., k = 0,1,2,...,2^m-1).
If the rows are written in a right-aligned fashion:
1,
2,1,
3,1, 3,2,
5,2,4,3, 4,1, 5,3,
8,3, 7,5,5,1,7,4, 7,3,5,4, 7,2, 8,5,
13,5,11,8,9,2,12,7,9,4,6,5,10,3,11,7,11,4,10,7,6,1,9,5,12,5,9,7,11,3,13,8,
then each column k also is a Fibonacci sequence.
If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are the reverses of blocks of A162911 ( a(2^m+k) = A162911(2^(m+1)-1-k), m = 0,1,2,..., k = 0,1,2,...,2^m-1). (End)

Examples

			The first four levels of the drib tree:
  [1/1],
  [1/2, 2/1],
  [2/3, 3/1, 1/3, 3/2],
  [3/5, 5/2, 1/4, 4/3, 3/4, 4/1, 2/5, 5/3].
		

Crossrefs

This sequence is the composition of A162910 and A059893: a(n) = A162910(A059893(n)). This sequence is a permutation of A002487(n+2).
Cf. A096773.

Programs

  • Haskell
    import Ratio; drib :: [Rational]; drib = 1 : map (recip . succ) drib \/ map (succ . recip) drib; (a : as) \/ bs = a : (bs \/ as); a162911 = map numerator drib; a162912 = map denominator drib
    
  • R
    blocklevel <- 6 # arbitrary
    a <- 1
    for(m in 0:blocklevel) for(k in 0:(2^m-1)){
      a[2^(m+1)+2*k]   <- a[2^(m+1)-1-k] + a[2^m+k]
      a[2^(m+1)+2*k+1] <- a[2^(m+1)-1-k]
    }
    a
    # Yosu Yurramendi, Jul 11 2014

Formula

b(n) where a(1) = 1; a(2n) = b(n); a(2n+1) = a(n) + b(n); and b(1) = 1; b(2n) = a(n) + b(n); b(2n+1) = a(n).
a(2^(m+1)+2*k) = a(2^m+k) + a(2^(m+1)-1-k) , a(2^(m+1)+2*k+1) = a(2^(m+1)-1-k) , a(1) = 1 , m=0,1,2,3,... , k=0,1,...,2^m-1. - Yosu Yurramendi, Jul 11 2014
a(2^(m+1) + 2*k + 1) = A162911(2^m + k), m >= 0, 0 <= k < 2^m.
a(2^(m+1) + 2*k) = A162911(2^m + k) + a(2^m + k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Mar 30 2016
a(n*2^(m+1) + A096773(m)) = A268087(n), n > 0, m >= 0. - Yosu Yurramendi, Feb 20 2017
a(n) = A002487(1+A258996(n)), n > 0. - Yosu Yurramendi, Jun 23 2021

Extensions

Edited by Charles R Greathouse IV, May 13 2010

A087445 Numbers that are congruent to 1 or 5 mod 12.

Original entry on oeis.org

1, 5, 13, 17, 25, 29, 37, 41, 49, 53, 61, 65, 73, 77, 85, 89, 97, 101, 109, 113, 121, 125, 133, 137, 145, 149, 157, 161, 169, 173, 181, 185, 193, 197, 205, 209, 217, 221, 229, 233, 241, 245, 253, 257, 265, 269, 277, 281, 289, 293, 301, 305, 313, 317, 325, 329
Offset: 1

Views

Author

Paul Barry, Sep 04 2003

Keywords

Comments

From Bob Selcoe, Jun 03 2015: (Start)
For k >= 1: all numbers congruent to A002450(k) mod 2^(2k+1) and A072197(k) mod 4^(k+1) not congruent to 0 mod 3. Equivalently, for k >= 3: all numbers congruent to A096773(k) mod 2^k not congruent to 0 mod 3.
Conjecture: at least one number in this sequence must appear in all Collatz sequences.
(End)
The sequence is composed of all numbers in congruence classes T(n,1) mod 2^(n+k) in A259663 (i.e., T"(1) in array T259663(n,k)) not congruent to 0 mod 3. Therefore the conjecture above is true (see A259663 for additional explanation). - Bob Selcoe, Jul 15 2017
Closure of {1} under the map (x,y)->2x+3y [Klarner-Rado, see Lagarias (2016), p. 755]. - N. J. A. Sloane, Oct 06 2016
The above conjecture is true: this is because even numbers and odd numbers divisible by 3 will lead to the set of odd numbers not divisible by 3. Odd numbers of the form 4k - 1 can also be ignored, as this consists of odd numbers that grow between themselves and the next odd term through Collatz iteration. No infinite sequence of growth between consecutive odd terms is possible, so all numbers of the form 4k - 1 will lead to an odd number that shrinks between itself and the next odd number. All numbers 4k - 1 will lead to a number in 4k - 3, the odd numbers that shrink between themselves and the following odd term. What we are left after that elimination is this sequence. - Aidan Simmons, Feb 25 2019

Crossrefs

Programs

  • Magma
    [k:k in [1..330]| k mod 12 in [1,5]]; // Marius A. Burtea, Feb 08 2020
  • Maple
    seq(6*(n-1)-(-1)^n,n=1..100); # Robert Israel, Jun 10 2015
  • Mathematica
    LinearRecurrence[{1,1,-1},{1,5,13},70] (* or *) Rest[CoefficientList[ Series[x (1+4x+7x^2)/((1+x)(1-x)^2),{x,0,70}],x]]  (* Harvey P. Dale, Jun 13 2011 *)
  • PARI
    a(n)=(n-1)\2*12 + [5,1][n%2+1] \\ Charles R Greathouse IV, Jun 03 2015
    

Formula

G.f.: x*(1+4*x+7*x^2)/((1+x)*(1-x)^2).
E.g.f.: 6*(x-1)*exp(x) + 7 - exp(-x). - corrected by Robert Israel, Jun 10 2015
a(n) = 6*(n-1) - (-1)^n. - Rolf Pleisch, Aug 04 2009
a(n) = 12*n - a(n-1) - 18 (with a(1)=1). - Vincenzo Librandi, Aug 08 2010
a(n) = a(n-1) + a(n-2) - a(n-3), with a(0)=1, a(1)=5, a(2)=13. - Harvey P. Dale, Jun 13 2011
Sum_{n>=1} (-1)^(n+1)/a(n) = sqrt(3)*Pi/12 + log(2 + sqrt(3))/(2*sqrt(3)). - Amiram Eldar, Dec 28 2021

A372286 a(n) = number of terms of A086893 that are in the interval [n, A371094(n)].

Original entry on oeis.org

1, 5, 2, 4, 2, 7, 1, 2, 2, 4, 2, 3, 2, 6, 1, 3, 1, 4, 2, 3, 2, 9, 1, 2, 1, 3, 1, 2, 2, 4, 2, 2, 2, 4, 2, 3, 2, 6, 2, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 8, 1, 2, 1, 3, 1, 3, 1, 5, 1, 3, 1, 3, 1, 3, 1, 6, 1, 3, 2, 4, 2, 3, 2, 5, 2, 3, 2, 4, 2, 3, 2, 11, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 5, 1, 2, 1, 3
Offset: 0

Views

Author

Antti Karttunen (proposed by Ali Sada), Apr 28 2024

Keywords

Comments

a(n) is the number of nonzero terms of A096773 that are found in the interval [n, A371094(n)], inclusive.

Examples

			A086893 = 1, 3, 5, 13, 21, 53, 85, 213, 341, 853, 1365, 3413, 5461, ...
For n=0, A371094(0) = 1, and only the initial term of A086893 is in the interval [0, 1], therefore a(0) = 1.
For n=1, A371094(1) = 21, so the first five terms of A086893 are in the interval [1, 21], thus a(1) = 5.
For n=6, A371094(6) = 19, and in the interval [6, 19] there is only term 13 of A086893, thus a(6) = 1.
For n=35, A371094(35) = 213, so we count terms 53, 85, 213 of A086893, therefore a(35) = 3.
		

Crossrefs

Cf. A002450 (seems to give the positions of records).

Programs

  • PARI
    A086893(n) = (if(n%2, 2^(n+1), 2^(n+1)+2^(n-1))\3); \\ From A086893
    A371094(n) = { my(m=1+3*n, e=valuation(m,2)); ((m*(2^e)) + (((4^e)-1)/3)); };
    A372286(n) = { my(u=A371094(n), k1); for(i=1,oo,if(A086893(i)>=n,k1=i-1; break)); for(i=k1,oo,if(A086893(i)>u,return(i-k1-1))); };

A372353 Array read by upward antidiagonals: A(n, k) = A372352(A372282(n, k)), n,k >= 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 24, 4, 0, 0, 0, 256, 32, 6, 0, 0, 0, 0, 6144, 16, 0, 0, 0, 0, 0, 16777216, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 8, 4, 0, 0, 0, 0, 0, 0, 0, 896, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6144, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16777216, 0, 56, 4
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2024

Keywords

Comments

Zeros occur in the same locations where 1's occur in array A372287.

Examples

			Array begins:
n\k| 1  2  3    4         5   6  7    8  9        10 11  12                 13
---+---------------------------------------------------------------------------
1  | 0, 0, 0,   2,        4,  6, 0,   2, 4,        6, 0,  2,                 4,
2  | 0, 0, 0,  24,       32, 16, 0,   8, 0,       32, 0, 56,                96,
3  | 0, 0, 0, 256,     6144,  0, 0, 896, 0,     6144, 0,  0,              8192,
4  | 0, 0, 0,   0, 16777216,  0, 0,   0, 0, 16777216, 0,  0,         402653184,
5  | 0, 0, 0,   0,        0,  0, 0,   0, 0,        0, 0,  0, 72057594037927936,
6  | 0, 0, 0,   0,        0,  0, 0,   0, 0,        0, 0,  0,                 0,
		

Crossrefs

Cf. also A372285 and A372355 (columnwise first differences).

Programs

A176965 a(n) = 2^(n-1) - (2^n*(-1)^n + 2)/3.

Original entry on oeis.org

1, 0, 6, 2, 26, 10, 106, 42, 426, 170, 1706, 682, 6826, 2730, 27306, 10922, 109226, 43690, 436906, 174762, 1747626, 699050, 6990506, 2796202, 27962026, 11184810, 111848106, 44739242, 447392426, 178956970, 1789569706, 715827882, 7158278826
Offset: 1

Views

Author

Roger L. Bagula, Apr 29 2010

Keywords

Comments

The ratio a(n+1)/a(n) approaches 10 for even n and 2/5 for odd n as n->infinity.

Crossrefs

Merger of A020988 (even n) and A020989 (odd n).

Programs

  • GAP
    List([1..30], n-> (3*2^(n-1) -(-2)^n -2)/3); # G. C. Greubel, Dec 28 2019
  • Magma
    [(3*2^(n-1) -(-2)^n -2)/3: n in [1..30]]; // G. C. Greubel, Dec 28 2019
    
  • Maple
    seq( (3*2^(n-1) -(-2)^n -2)/3, n=1..30); # G. C. Greubel, Dec 28 2019
  • Mathematica
    a[n_]:= a[n]= 2^(n-1)*If[n==1, 1, a[n-1]/2 +(-1)^(n-1)*Sqrt[(5 +4*(-1)^(n-1) )]/2]; Table[a[n], {n,30}]
    LinearRecurrence[{1,4,-4}, {1,0,6}, 30] (* G. C. Greubel, Dec 28 2019 *)
  • PARI
    vector(30, n, (3*2^(n-1) -(-2)^n -2)/3 ) \\ G. C. Greubel, Dec 28 2019
    
  • Sage
    [(3*2^(n-1) -(-2)^n -2)/3 for n in (1..30)] # G. C. Greubel, Dec 28 2019
    

Formula

From R. J. Mathar, Apr 30 2010: (Start)
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
G.f.: x*(1 - x + 2*x^2)/( (1-x)*(1+2*x)*(1-2*x) ). (End)
a(n) = A087231(n), n > 2. - R. J. Mathar, May 03 2010
a(2n-1) = A061547(2n), a(2n) = A061547(2n-1), n > 0. - Yosu Yurramendi, Dec 23 2016
a(n+1) = 2*A096773(n), n > 0. - Yosu Yurramendi, Dec 30 2016
a(2n-1) = A020989(n-1), a(2n) = A020988(n-1), n > 0. - Yosu Yurramendi, Jan 03 2017
a(2n-1) = (A083597(n-1) + A000302(n-1))/2, a(2n) = (A083597(n-1) - A000302(n-1))/2, n > 0. - Yosu Yurramendi, Mar 04 2017
a(n+2) = 4*a(n) + 2, a(1) = 1, a(2) = 0, n > 0. - Yosu Yurramendi, Mar 07 2017
a(n) = (-16 + (9 - (-1)^n) * 2^(n - (-1)^n))/24. - Loren M. Pearson, Dec 28 2019
E.g.f.: (3*exp(2*x) - 4*exp(x) + 3 - 2*exp(-2*x))/6. - G. C. Greubel, Dec 28 2019
a(n) = (2^n*5^(n mod 2) - 4)/6. - Heinz Ebert, Jun 29 2021

A255138 a(n) = (1 + 2^n*(3 + 2*(-1)^n))/3.

Original entry on oeis.org

2, 1, 7, 3, 27, 11, 107, 43, 427, 171, 1707, 683, 6827, 2731, 27307, 10923, 109227, 43691, 436907, 174763, 1747627, 699051, 6990507, 2796203, 27962027, 11184811, 111848107, 44739243, 447392427, 178956971
Offset: 0

Views

Author

L. Edson Jeffery, May 04 2015

Keywords

Comments

Let N_1 be the set of odd natural numbers and v(y) the 2-adic valuation of y. Define the map F : N_1 -> N_1 by F(x) = (3*x+1)/2^v(3*x+1) (see A075677). Let F^(k)(x) denote k-fold iteration of F, with recurrence F^(k)(x) = F(F^(k-1)(x)), k > 0, and initial condition F^(0)(x) = x. Then, for n>0, a(n) is the least m such that F^(n)(4*m-3) == 1 (mod 4). Cf. A257499.
Let k == 1 mod 4, and k(r) be the r-th iteration at which k appears in a Collatz sequence. When n >= 2 and k(r) == [2^(n+1) - a(n)] mod 2^(n+1), then n is the number of halving steps following k(r+1). For instance, since a(5) = 11, there are 5 halving steps following k(r+1) when k(r) == 53 mod 64, because 2^(5+1) = 64 and 64-11 = 53; e.g., k(r) = 117: 117 -> 352 -> 176 -> 88 -> 44 -> 22 -> 11. - Bob Selcoe, Feb 09 2017

Crossrefs

Programs

  • Magma
    [(1 + 2^n*(3 + 2*(-1)^n))/3: n in [0..50]]; // Wesley Ivan Hurt, Nov 05 2015
  • Maple
    A255138:=n->(1 + 2^n*(3 + 2*(-1)^n))/3: seq(A255138(n), n=0..50); # Wesley Ivan Hurt, Nov 05 2015
  • Mathematica
    a[n_] := (1 + 2^n*(3 + 2*(-1)^n))/3; Table[a[n], {n, 0, 29}]
    LinearRecurrence[{1,4,-4},{2,1,7},30] (* Harvey P. Dale, Aug 03 2024 *)
  • PARI
    vector(30, n, n--; (1 + 2^n*(3 + 2*(-1)^n))/3) \\ Altug Alkan, Nov 05 2015
    

Formula

a(2*n) = A136412(n); a(2*n+1) = A007583(n).
G.f.: (2-x-2*x^2)/((x-1)*(2*x-1)*(2*x+1)). - R. J. Mathar, Jul 25 2015
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n > 2. - Wesley Ivan Hurt, Nov 05 2015
a(n) = 4*a(n-2) - 1. - Bob Selcoe, Feb 09 2017
a(n) = 2^(n+1) - A096773(n+1). - Ruud H.G. van Tol, Sep 04 2023

A140503 Triangle T(d,n) read by rows, the n-th term of the d-th differences of the Jacobsthal sequence A001045.

Original entry on oeis.org

1, -1, 2, 3, -2, 4, -5, 6, -4, 8, 11, -10, 12, -8, 16, -21, 22, -20, 24, -16, 32, 43, -42, 44, -40, 48, -32, 64, -85, 86, -84, 88, -80, 96, -64, 128, 171, -170, 172, -168, 176, -160, 192, -128, 256, -341, 342, -340, 344, -336, 352, -320, 384, -256, 512, 683, -682, 684, -680
Offset: 1

Views

Author

Paul Curtz, Jun 30 2008

Keywords

Comments

If interpreted as a flat sequence a(j), we obtain a(j+1)-2a(j)= -3, 4, -1, -8, 8, -13, 16, -16, 16, -5, -32, 32, -32, 32, -53, 64, ... which is essentially the negative values of A096773 padded by groups of one, then two, then three etc. signed elements of A098354.

Examples

			A001045 and its d times iterated differences are
.0,.1,.1,.3,.5,11,21,43,...
.1,.0,.2,.2,.6,10,22,... < d=1
-1,.2,.0,.4,.4,12,... < d=2
.3,-2,.4,.0,.8,.. < d=3
-5,.6,-4,.8,.0,...
The sequence contains the first d elements of the d-th row, those up to the diagonal (which contains zeros).
		

Crossrefs

Cf. A001045, A140944 (with an extra diagonal of 0's).

Programs

  • PARI
    T(d,n) = (2^n - 2^d*(-1)^(d+n))/3 \\ Jianing Song, Aug 11 2022

Formula

T(d,n)=T(d-1,n+1)-T(d-1,n). T(0,n)=A001045(n).
Row sums: sum_{n=0..d-1} T(d,n) = A002450([(d+1)/2]).
Row sums of absolute values: sum_{n=0..d-1} |T(d,n)| = A045883(d).
T(d,n) = (2^n - 2^d*(-1)^(d+n))/3, for d > n >= 0. - Jianing Song, Aug 11 2022

Extensions

Edited by R. J. Mathar, Jul 14 2008
Showing 1-10 of 14 results. Next