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

A353314 If n is of the form 3k, then a(n) = n, and if n is of the form 3k+r, with r = 1 or 2, then a(n) = 5*k + 3 + r.

Original entry on oeis.org

0, 4, 5, 3, 9, 10, 6, 14, 15, 9, 19, 20, 12, 24, 25, 15, 29, 30, 18, 34, 35, 21, 39, 40, 24, 44, 45, 27, 49, 50, 30, 54, 55, 33, 59, 60, 36, 64, 65, 39, 69, 70, 42, 74, 75, 45, 79, 80, 48, 84, 85, 51, 89, 90, 54, 94, 95, 57, 99, 100, 60, 104, 105, 63, 109, 110, 66, 114, 115, 69, 119, 120, 72, 124, 125, 75, 129, 130
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2022

Keywords

Crossrefs

Cf. A353313 (variant), A349876 (the first multiple of 3 reached when iterating this sequence), A349877 (number of iterations to reach the first multiple of 3), A353327 (A102899).

Programs

  • Mathematica
    Array[If[#2 == 0, #1, 5 #1 + 3 + #2 & @@ QuotientRemainder[#1, 3]] & @@ {#, Mod[#, 3]} &, 78, 0] (* Michael De Vlieger, Apr 14 2022 *)
  • PARI
    A353314(n) = { my(r=(n%3)); if(!r,n,((5*((n-r)/3)) + r + 3)); };

Formula

a(n) = n + A353327(n) = n + A102899(3+n).
From Chai Wah Wu, Jul 27 2022: (Start)
a(n) = 2*a(n-3) - a(n-6) for n > 5.
G.f.: x*(x^3 + 3*x^2 + 5*x + 4)/(x^6 - 2*x^3 + 1). (End)

A120691 First differences of coefficients in the continued fraction for e.

Original entry on oeis.org

2, -1, 1, -1, 0, 3, -3, 0, 5, -5, 0, 7, -7, 0, 9, -9, 0, 11, -11, 0, 13, -13, 0, 15, -15, 0, 17, -17, 0, 19, -19, 0, 21, -21, 0, 23, -23, 0, 25, -25, 0, 27, -27, 0, 29, -29, 0, 31, -31, 0, 33, -33, 0, 35, -35, 0, 37, -37, 0, 39, -39
Offset: 0

Views

Author

Paul Barry, Jun 27 2006

Keywords

Comments

First differences of A003417.

Crossrefs

Programs

  • Magma
    R:=PowerSeriesRing(Integers(), 70); Coefficients(R!( (1-x)*(2+x+2*x^2-3*x^3-x^4+x^6)/(1-x^3)^2 )); // G. C. Greubel, Dec 28 2022
    
  • Mathematica
    Join[{2},Differences[ContinuedFraction[E,120]]] (* or *) LinearRecurrence[{-1,-1,1,1,1},{2,-1,1,-1,0,3,-3},120] (* Harvey P. Dale, Jun 08 2016 *)
  • PARI
    A120691(n)={n<2 && return(2-3*n); n=divrem(n-1,3); if(n[2],-(1+n[1]*2)*(-1)^n[2])} \\ - M. F. Hasler, May 01 2013
    
  • SageMath
    def b(n):
        if (n%3==1): return 0
        elif (n%3==2): return (2*n-1)/3
        else: return (3-2*n)/3
    def A120691(n): return b(n) + (-1)^n*int(n<2)
    [A120691(n) for n in range(71)] # G. C. Greubel, Dec 28 2022

Formula

G.f.: (1-x)*(2+x+2*x^2-3*x^3-x^4+x^6)/(1-2*x^3+x^6).
a(n) = 2*C(0,n) -C(1,n) +2*sin(2*Pi*(n-1)/3)*floor((2*n-1)/3)/sqrt(3). [Sign corrected by M. F. Hasler, May 01 2013]
a(0)=2, a(1)=-1, for n>0: a(3*n-1) = 2*n-1, a(3*n) = 1-2*n, a(3*n+1) = 0. - M. F. Hasler, May 01 2013
a(n) = - a(n-1) - a(n-2) + a(n-3) + a(n-4) + a(n-5) for n > 6. - Chai Wah Wu, Jul 27 2022
a(n) = 0 if n mod 3 = 1, a(n) = (2*n-1)/3 if n mod 3 = 2, a(n) = (3-2*n)/3 otherwise, with a(0) = 2, and a(1) = -1. - G. C. Greubel, Dec 28 2022

A353327 If n is a multiple of 3, then a(n) = 0, and if n is of the form 3k+r, with r = 1 or 2, then a(n) = 2*k + 3.

Original entry on oeis.org

0, 3, 3, 0, 5, 5, 0, 7, 7, 0, 9, 9, 0, 11, 11, 0, 13, 13, 0, 15, 15, 0, 17, 17, 0, 19, 19, 0, 21, 21, 0, 23, 23, 0, 25, 25, 0, 27, 27, 0, 29, 29, 0, 31, 31, 0, 33, 33, 0, 35, 35, 0, 37, 37, 0, 39, 39, 0, 41, 41, 0, 43, 43, 0, 45, 45, 0, 47, 47, 0, 49, 49, 0, 51, 51, 0, 53, 53, 0, 55, 55, 0, 57, 57, 0, 59, 59, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 14 2022

Keywords

Crossrefs

Programs

  • PARI
    A353327(n) = { my(r=(n%3)); if(!r,0,((2*((n-r)/3)) + 3)); };

Formula

a(n) = A353314(n) - n.
a(n) = A102899(3+n).
From Chai Wah Wu, Jul 27 2022: (Start)
a(n) = 2*a(n-3) - a(n-6) for n > 5.
G.f.: x*(-x^4 - x^3 + 3*x + 3)/(x^6 - 2*x^3 + 1). (End)
Showing 1-3 of 3 results.