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.

A347365 a(n) = n * (2-(-1)^n), or zero together with first differences of even triangular numbers halved (A074378).

Original entry on oeis.org

0, 3, 2, 9, 4, 15, 6, 21, 8, 27, 10, 33, 12, 39, 14, 45, 16, 51, 18, 57, 20, 63, 22, 69, 24, 75, 26, 81, 28, 87, 30, 93, 32, 99, 34, 105, 36, 111, 38, 117, 40, 123, 42, 129, 44, 135, 46, 141, 48, 147, 50, 153, 52, 159, 54, 165, 56, 171, 58, 177, 60, 183, 62, 189, 64
Offset: 0

Views

Author

Federico Provvedi, Aug 29 2021

Keywords

Comments

This sequence and A165998 form a complementary pair as solutions of alternating sequences a(n) + b(n) = 4*n (A008586), and a(n)*b(n) = 3*n^2 (A033428).
This is the particular case of the two integer sequences x(n)=2n and y(n)=n, where more generally, x(n) + y(n) = 2*a(n) and x(n)*y(n) = (a(n) + b(n)) * (a(n) - b(n)) give the two conjugate binomials a(n) = x(n) + (-1)^n*y(n) and b(n) = x(n) - (-1)^n*y(n) as solutions over the integer domain.
a(n) is also A005843 and A016945 interleaved.
For every integer k: a(n*k) = n*k is multiplicative for nonnegative even integers n and a(n*k) = n*a(k) for nonnegative odd integers n.
For every nonnegative odd integer k, the k-th difference of a(k*n)/k = (2n+1)*(-1)^n + 2 = A166519(n), and 1 for all nonnegative even integers.
a(6n+1)/3 = 6n+1, and a(6n+5)/3 = 6n+5, related to Collatz Conjecture.
Half-periods of a(k) mod n is A026741(n).

Crossrefs

Programs

  • Mathematica
    Table[n(2-(-1)^n),{n,0,99}] (* or *)
    LinearRecurrence[{0,2,0,-1}, {0,3,2,9}, 100] (* or *)
    If[EvenQ@#,#,3#]&/@Range[0,99]  (* or *)
    Drop[Flatten@Transpose[{2#,6#+3}&@Range[0,Quotient[#,2]]],-Boole@EvenQ@#]&@(10^2)
  • PARI
    a(n) = n*(2-(-1)^n); \\ Michel Marcus, Sep 13 2021
  • Sage
    (x*(3+2*x+3*x^2)/(1-x^2)^2).series(x,65).coefficients(x,sparse=False) # Stefano Spezia, Aug 30 2021
    

Formula

G.f.: x*(3 + 2*x + 3*x^2)/(1 - x^2)^2.
E.g.f.: x*(3*cosh(x) + sinh(x)).
Dirichlet g.f.: 2^(-s) * (3*2^s - 4) * zeta(s-1) = (3 - 4/2^s) * zeta(s-1) = (3 - 1/2^(s-2)) * zeta(s-1).
a(n) = n*(2-(-1)^n) = 3*n / (2+(-1)^n).
a(n) = 3*n if n odd, a(n) = n if n even, implies a(a(2n)) = 2n, a(a(2n+1)) = 9*a(2n+1).
a(n) = 3*b(n), if n odd and a(n) = b(n)/3, if n even, with b(n) = A165998(n).
a(n) = a(a(2k*n)/(2k)) = a((2k+1)*n) / (2k+1), since a(2*k*n) / (2*k) = n.
a(n) = 4*n - A165998(n).
a(n+1) = a(n) + A086970(n+1)*(-1)^n.
a(n) = 2*A014682(n) - A000035(n).
a(n) = n*A010684(n). - Michel Marcus, Sep 13 2021
For positive integers k and n, a(n) = A(n,1) = n * (A(n,k)/n)^(1/k), where the k-th nesting composition A(n,k) = a(a(...a(a(n))...)) = n * ( a(n) / n )^k, and d.g.f. of A(n,k) = (2^(1-s) + (1-2^(1-s))*3^k) * zeta(s-1). - Federico Provvedi, Sep 18 2021
a(n+1) = A165998(n)*(1 + 1/n). - Federico Provvedi, Sep 19 2021