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

A178142 Sum over the divisors d = 2 and/or 3 of n.

Original entry on oeis.org

0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3, 2, 0, 5, 0, 2, 3
Offset: 1

Views

Author

Vladimir Shevelev, May 21 2010

Keywords

Comments

Periodic with period {0,2,3,2,0,5}.

Crossrefs

Programs

  • Mathematica
    Table[Total@ Select[Divisors@ n, 2 <= # <= 3 &], {n, 120}] (* or *)
    Table[Total[Divisors@ n /. {d_ /; d < 2 -> Nothing, d_ /; d > 3 -> Nothing} ], {n, 120}] (* Michael De Vlieger, Feb 07 2016 *)
    Flatten[Table[{0,2,3,2,0,5}, {16}]] (* Amiram Eldar, Aug 03 2024 *)
  • PARI
    a(n) = sumdiv(n, d, d*((d==2) || (d==3))); \\ Michel Marcus, Feb 07 2016
    
  • PARI
    a(n) = [0,2,3,2,0,5][(n-1) % 6 + 1]; \\ Amiram Eldar, Aug 03 2024

Formula

a(n) = Sum_{d|n, d=2 or d=3} d.
a(n+6) = a(n).
a(n) = -a(n-1) + a(n-3) + a(n-4).
G.f.: -x*(2+5*x+5*x^2) / ( (x-1)*(1+x)*(1+x+x^2) ).
a(n) = A010673(n) + A021337(n). - R. J. Mathar, May 28 2010
a(n) = A000203(n) - A171405(n). - Amiram Eldar, Aug 03 2024

Extensions

Replaced recurrence by a shorter one; added keyword:less - R. J. Mathar, May 28 2010

A146325 Period 3: repeat [1, 4, 1].

Original entry on oeis.org

1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 1
Offset: 1

Views

Author

Artur Jasinski, Oct 30 2008

Keywords

Comments

Continued fraction of (1 + sqrt(26))/5 = A188659.
Digital roots of the centered triangular numbers A005448. - Ant King, May 08 2012
Also the digital roots of centered 12-gonal numbers A003154. - Peter M. Chema, Dec 20 2023

Crossrefs

Cf. A003154, A005448, A021337, A131534 (square roots), A188659.

Programs

  • Magma
    &cat [[1,4,1]^^40]; // Bruno Berselli, Jun 27 2016
  • Maple
    seq(op([1, 4, 1]), n=1..50); # Wesley Ivan Hurt, Jul 01 2016
  • Mathematica
    Table[Round[N[4 (Cos[(2 n - 1) ArcTan[Sqrt[3]]])^2, 100]], {n, 1, 100}]
    PadLeft[{},111,{1,4,1}] (* Harvey P. Dale, Sep 18 2011 *)
  • PARI
    a(n)=1+3*(n%3==2) \\ Jaume Oliver Lafont, Mar 24 2009
    

Formula

a(n) = 4*(cos((2*n - 1)*Pi/3))^2 = 4 - 4*(sin((2*n - 1)*Pi/3))^2.
a(n+3) = a(n).
a(n) = 2 - cos(2*Pi*n/3) + sqrt(3)*sin(2*Pi*n/3).
O.g.f.: x*(1+4*x+x^2)/(1-x^3). [Richard Choulet, Nov 03 2008]
a(n) = 6 - a(n-1) - a(n-2) for n>2. - Ant King, Jun 12 2012
a(n) = (n mod 3)^(n mod 3). - Bruno Berselli, Jun 27 2016
a(n) = 1 + A021337(n) for n>0. - Wesley Ivan Hurt, Jul 01 2016
Showing 1-2 of 2 results.