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-4 of 4 results.

A123402 Combining the conditional divide-by-two concept from Collatz sequences with Pascal's triangle, one can construct a new kind of triangle. Start with an initial row of just 4. To compute subsequent rows, start by appending a zero to the beginning and end of the previous row. Like Pascal's triangle, add adjacent terms of the previous row to create each of the subsequent terms. The only change is that each new term is divided by two if it is even.

Original entry on oeis.org

4, 2, 2, 1, 2, 1, 1, 3, 3, 1, 1, 2, 3, 2, 1, 1, 3, 5, 5, 3, 1, 1, 2, 4, 5, 4, 2, 1, 1, 3, 3, 9, 9, 3, 3, 1, 1, 2, 3, 6, 9, 6, 3, 2, 1, 1, 3, 5, 9, 15, 15, 9, 5, 3, 1, 1, 2, 4, 7, 12, 15, 12, 7, 4, 2, 1, 1, 3, 3, 11, 19, 27, 27, 19, 11, 3, 3, 1, 1, 2, 3, 7, 15, 23, 27, 23, 15, 7, 3, 2, 1, 1, 3, 5, 5, 11, 19
Offset: 0

Views

Author

Reed Kelly, Oct 14 2006

Keywords

Examples

			For the row starting with (1,2,4,5,8,...) the subsequent row is computed as follows: 0+1->1, 1+2->3, (2+4)/2->3, 4+5->9, 5+8->13...
		

Crossrefs

Programs

  • Mathematica
    CollatzPascalTriangle[init_, n_] := Module[{CPT, ROWA, ROWB, a, i, j}, If[ListQ[init], ROWA = init, ROWA = {4}]; CPT = {ROWA}; ROWA = Flatten[{0, ROWA, 0}]; For[i = 1, i < n, i++, ROWB = {0}; For[j = 1, j < Length[ROWA], j++, a = ROWA[[j]] + ROWA[[j + 1]]; a = a/(2 - Mod[a, 2]); ROWB = Append[ROWB, a];]; CPT = Append[CPT, Rest[ROWB]]; ROWA = Append[ROWB, 0]]; CPT] Flatten[ CollatzPascalTriangle[{4},20]]

Formula

Define a(n, m) for integers m, n: a(0, 0)=4, a(n, m) := 0 for m<0 and n

A151749 a(0) = 1, a(1) = 3; a(n+2) = (a(n+1) + a(n))/2 if 2 divides (a(n+1) + a(n)), a(n+2) = a(n+1) + a(n) otherwise.

Original entry on oeis.org

1, 3, 2, 5, 7, 6, 13, 19, 16, 35, 51, 43, 47, 45, 46, 91, 137, 114, 251, 365, 308, 673, 981, 827, 904, 1731, 2635, 2183, 2409, 2296, 4705, 7001, 5853, 6427, 6140, 12567, 18707, 15637, 17172, 32809, 49981, 41395, 45688, 87083, 132771, 109927, 121349, 115638
Offset: 0

Author

N. J. A. Sloane, Jun 17 2009

Keywords

Comments

Greene discusses the whole family of sequences defined by a rule of the form a(n) = (Sum_{i=1..k} c_i a(i))/ (Sum_{i=1..k} c_i) if (Sum_{i=1..k} c_i) divides (Sum_{i=1..k} c_i a(i)), a(n) = (Sum_{i=1..k} c_i a(i)) if not, where k and the c_i are nonnegative integers and a(0), ..., a(k-1) are specified initial terms. Many further examples of such sequences could be added to the OEIS!

Crossrefs

Cf. A069202.

Programs

  • Maple
    A151749 := proc(n) option remember; if n <= 1 then 1+2*n; else prev := procname(n-1)+procname(n-2) ; if prev mod 2 = 0 then prev/2 ; else prev; fi; fi; end: seq(A151749(n),n=0..80) ; # R. J. Mathar, Jun 18 2009
  • Mathematica
    f[{a_,b_}]:=Module[{c=a+b},If[EvenQ[c],c/2,c]]; Transpose[NestList[ {Last[#],f[#]}&,{1,3},50]][[1]] (* Harvey P. Dale, Oct 12 2011 *)

Extensions

More terms from R. J. Mathar, Jun 18 2009

A120424 Having specified two initial terms, the "Half-Fibonacci" sequence proceeds like the Fibonacci sequence, except that the terms are halved before being added if they are even.

Original entry on oeis.org

1, 3, 4, 5, 7, 12, 13, 19, 32, 35, 51, 86, 94, 90, 92, 91, 137, 228, 251, 365, 616, 673, 981, 1654, 1808, 1731, 2635, 4366, 4818, 4592, 4705, 7001, 11706, 12854, 12280, 12567, 18707, 31274, 34344, 32809, 49981, 82790, 91376, 87083, 132771, 219854
Offset: 0

Author

Reed Kelly, Jul 11 2006

Keywords

Comments

For sequences that are infinitely increasing, the following are possible conjectures. Half of the terms are even in the limit. There are infinitely many consecutive pairs that differ by 1.
This is essentially a variant of the Collatz - Fibonacci mixture described in A069202. Instead of conditionally dividing the result by 2, this sequence conditionally divides the two previous terms by 2. The initial two terms of A069202 are 1,2, which corresponds to the initial terms 1,4 for this sequence.

Examples

			Given a(21)=100 and a(22)=117, then a(23)=50+117=167. Given a(13)=64 and a(14)=68, then a(15)=32+34=66.
		

Crossrefs

Cf. A069202.

Programs

  • Mathematica
    HalfFib[a_, b_, n_] := Module[{HF, i}, HF = {a, b}; For [i = 3, i < n, i++, HF = Append[HF, HF[[i - 2]]/(2 - Mod[HF[[i - 2]], 2]) + HF[[i - 1]]/(2 - Mod[HF[[i - 1]], 2])]]; HF] HalfFib[1,3,100]
    nxt[{a_,b_}]:={b,If[EvenQ[a],a/2,a]+If[EvenQ[b],b/2,b]}; NestList[nxt,{1,3},50][[All,1]] (* Harvey P. Dale, Nov 19 2019 *)

Formula

a(n) = (a(n-1) if a(n-1) is odd, else a(n-1)/2) + (a(n-2) if a(n-2) is odd, else a(n-2)/2).

A333301 a(1) = 1, a(2) = 2. For n>2, if a(n-1) is odd, a(n) = a(n-1) + a(n-2), and otherwise a(n) is the smallest missing number.

Original entry on oeis.org

1, 2, 3, 5, 8, 4, 6, 7, 13, 20, 9, 29, 38, 10, 11, 21, 32, 12, 14, 15, 29, 44, 16, 17, 33, 50, 18, 19, 37, 56, 22, 23, 45, 68, 24, 25, 49, 74, 26, 27, 53, 80, 28, 30, 31, 61, 92, 34, 35, 69, 104, 36, 39, 75, 114, 40, 41, 81, 122, 42, 43, 85, 128, 46, 47, 93, 140, 48, 51, 99, 150, 52, 54, 55, 109, 164
Offset: 1

Author

Andrew Slattery, Jun 08 2020

Keywords

Comments

How many times does each number appear?

Examples

			a(10) is even, so a(11) is the least number yet to appear, which is 9.
		

Crossrefs

Showing 1-4 of 4 results.