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.

A318265 a(1) = 1, a(n) = 5*a(n/3) if n is divisible by 3, otherwise a(n) = n - a(n-1).

Original entry on oeis.org

1, 1, 5, -1, 6, 5, 2, 6, 25, -15, 26, -5, 18, -4, 30, -14, 31, 25, -6, 26, 10, 12, 11, 30, -5, 31, 125, -97, 126, -75, 106, -74, 130, -96, 131, -25, 62, -24, 90, -50, 91, -20, 63, -19, 150, -104, 151, -70, 119, -69, 155, -103, 156, 125, -70, 126, -30, 88, -29, 130, -69, 131, 50, 14, 51, 60, 7, 61, 55, 15, 56, 150
Offset: 1

Views

Author

Altug Alkan and Antti Karttunen, Aug 22 2018

Keywords

Comments

From a generalization of A317825.

Crossrefs

Programs

  • PARI
    a(n)=if(n==1, n, if(n%3==0, 5*a(n/3),n-a(n-1)));

A318303 a(0) = 0, a(n) = n + a(n-1) if n is odd, a(n) = -3*a(n/2) if n is even.

Original entry on oeis.org

0, 1, -3, 0, 9, 14, 0, 7, -27, -18, -42, -31, 0, 13, -21, -6, 81, 98, 54, 73, 126, 147, 93, 116, 0, 25, -39, -12, 63, 92, 18, 49, -243, -210, -294, -259, -162, -125, -219, -180, -378, -337, -441, -398, -279, -234, -348, -301, 0, 49, -75, -24, 117, 170, 36, 91, -189, -132, -276, -217, -54, 7, -147, -84, 729, 794, 630
Offset: 0

Views

Author

Altug Alkan, Aug 24 2018

Keywords

Comments

Let g_k(0) = 0. g_k(n) = n + g_k(n-1) if n is odd, g_k(n) = k*a(n/2) if n is even. A228451(n) is g_1(n), A298011(n) is g_2(n). This sequence is a(n) = g_k(n) where k = -3.

Crossrefs

Programs

  • Mathematica
    Nest[Append[#1, If[OddQ@ #2, #2 + #1[[-1]], -3 #1[[#2/2 + 1]] ]] & @@ {#, Length@ #} &, {0}, 66] (* Michael De Vlieger, Aug 25 2018 *)
  • PARI
    a(n)=if(n==0, 0, if(n%2, n+a(n-1), -3*a(n/2)));

A309790 G.f. A(x) satisfies: A(x) = 2*x*(1 - x)*A(x^2) + x/(1 - x).

Original entry on oeis.org

0, 1, 1, 3, -1, 3, -1, 7, -5, -1, 3, 7, -5, -1, 3, 15, -13, -9, 11, -1, 3, 7, -5, 15, -13, -9, 11, -1, 3, 7, -5, 31, -29, -25, 27, -17, 19, 23, -21, -1, 3, 7, -5, 15, -13, -9, 11, 31, -29, -25, 27, -17, 19, 23, -21, -1, 3, 7, -5, 15, -13, -9, 11, 63, -61, -57, 59
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 28 2019

Keywords

Crossrefs

Cf. A000225 (fixed points), A006257.
Compare also to the scatter plots of A117966, A317825.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, 2*
         `if`(irem(n, 2, 'r')=0, -a(r-1), a(r))+1)
        end:
    seq(a(n), n=0..2^7-2);  # Alois P. Heinz, Aug 29 2019
  • Mathematica
    nmax = 66; A[] = 0; Do[A[x] = 2 x (1 - x) A[x^2] + x/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    a[0] = 0; a[n_] := If[EvenQ[n], -2 a[(n - 2)/2] + 1, 2 a[(n - 1)/2] + 1]; Table[a[n], {n, 0, 66}]

Formula

a(0) = 0; a(2*n+2) = -2*a(n) + 1, a(2*n+1) = 2*a(n) + 1.

A318388 a(1) = 1, a(n) = -floor(e*a(n/2)) if n is even, a(n) = n - a(n-1) if n is odd.

Original entry on oeis.org

1, -2, 5, 6, -1, -13, 20, -16, 25, 3, 8, 36, -23, -54, 69, 44, -27, -67, 86, -8, 29, -21, 44, -97, 122, 63, -36, 147, -118, -187, 218, -119, 152, 74, -39, 183, -146, -233, 272, 22, 19, -78, 121, 58, -13, -119, 166, 264, -215, -331, 382, -171, 224, 98, -43, -399, 456, 321, -262, 509, -448, -592, 655, 324, -259, -413
Offset: 1

Views

Author

Altug Alkan, Aug 25 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Nest[Append[#1, If[EvenQ@ #2, -Floor[E #1[[#2/2]] ], #2 - #1[[-1]] ]] & @@ {#, Length@ # + 1} &, {1}, 65] (* Michael De Vlieger, Aug 25 2018 *)
  • PARI
    a(n)=if(n==1, 1, if(n%2==0, -floor(exp(1)*a(n/2)), n-a(n-1)));
Showing 1-4 of 4 results.