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.

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

A178144 Sum of divisors d of n which are d=2, 3 or 5.

Original entry on oeis.org

0, 2, 3, 2, 5, 5, 0, 2, 3, 7, 0, 5, 0, 2, 8, 2, 0, 5, 0, 7, 3, 2, 0, 5, 5, 2, 3, 2, 0, 10, 0, 2, 3, 2, 5, 5, 0, 2, 3, 7, 0, 5, 0, 2, 8, 2, 0, 5, 0, 7, 3, 2, 0, 5, 5, 2, 3, 2, 0, 10, 0, 2, 3, 2, 5, 5, 0, 2, 3, 7, 0, 5, 0, 2, 8, 2, 0, 5, 0, 7, 3, 2, 0, 5, 5, 2, 3, 2, 0, 10, 0, 2, 3, 2, 5, 5, 0, 2, 3, 7, 0, 5, 0, 2, 8
Offset: 1

Views

Author

Vladimir Shevelev, May 21 2010

Keywords

Comments

The sequence is periodic with period length 30.

Crossrefs

Programs

  • Maple
    A178144 := proc(n)
        local a;
        a := 0 ;
        for d in {2,3,5} do
            if (n mod d) = 0 then
                a := a+d ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 23 2012
  • Mathematica
    a[n_] := DivisorSum[n, Boole[MatchQ[#, 2|3|5]]*#&];
    Array[a, 105] (* Jean-François Alcover, Nov 24 2017 *)
    a[n_] := Sum[d * Boole[Divisible[n, d]], {d, {2, 3, 5}}]; Array[a, 100] (* Amiram Eldar, Dec 20 2024 *)
  • PARI
    a(n) = sumdiv(n, d, if ((d==2) || (d==3) || (d==5), d)); \\ Michel Marcus, Nov 24 2017
    
  • PARI
    a(n) = my(d = [2, 3, 5]); sum(k = 1, 3, d[k] * !(n % d[k])); \\ Amiram Eldar, Dec 20 2024

Formula

From R. J. Mathar, Jul 23 2012: (Start)
a(n) = -2*a(n-1) -2*a(n-2) -a(n-3) +a(n-5) +2*a(n-6) +2*a(n-7) +a(n-8).
G.f.: ( -x*(2+7*x+12*x^2+17*x^3+22*x^4+10*x^6+20*x^5) ) / ( (x-1)*(1+x)*(1+x+x^2)*(x^4+x^3+x^2+x+1) ). (End)

A178146 a(n) is the number of distinct prime factors <= 5 of n.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, May 21 2010

Keywords

Comments

The sequence is periodic with period {0 1 1 1 1 2 0 1 1 2 0 2 0 1 2 1 0 2 0 2 1 1 0 2 1 1 1 1 0 3} of length 30. There are 26 coincidences on the interval [1,30] with A156542.

Crossrefs

Number of distinct prime factors <= p: A171182 (p=3), this sequence (p=5), A210679 (p=7).

Programs

  • Mathematica
    Rest@ CoefficientList[Series[-x^2*(3*x^6 + 6*x^5 + 7*x^4 + 6*x^3 + 5*x^2 + 3*x + 1)/((x - 1)*(x + 1)*(x^2 + x + 1)*(x^4 + x^3 + x^2 + x + 1)), {x, 0, 50}], x] (* G. C. Greubel, May 16 2017 *)
    LinearRecurrence[{-2,-2,-1,0,1,2,2,1},{0,1,1,1,1,2,0,1},120] (* Harvey P. Dale, Sep 29 2021 *)
    a[n_] := PrimeNu[GCD[n, 30]]; Array[a, 100] (* Amiram Eldar, Sep 16 2023 *)
  • PARI
    my(x='x+O('x^50)); concat([0], Vec(-x^2*(3*x^6+6*x^5+7*x^4+6*x^3+5*x^2+3*x+1)/((x-1)*(x+1)*(x^2+x+1)*(x^4+x^3+x^2+x+1)))) \\ G. C. Greubel, May 16 2017
    
  • PARI
    a(n) = omega(gcd(n, 30)); \\ Amiram Eldar, Sep 16 2023

Formula

a(n) = a(n-2) + a(n-3) - a(n-7) - a(n-8) + a(n-10), a(1) = 0, a(2) = 1, a(3) = 1, a(4) = 1, a(5) = 1, a(6) = 2, a(7) = 0, a(8) = 1, a(9) = 1, a(10) = 2.
G.f.: -x^2*(3*x^6+6*x^5+7*x^4+6*x^3+5*x^2+3*x+1) / ((x-1)*(x+1)*(x^2+x+1)*(x^4+x^3+x^2+x+1)). - Colin Barker, Mar 13 2013
From Amiram Eldar, Sep 16 2023: (Start)
Additive with a(p^e) = 1 if p <= 5, and 0 otherwise.
a(n) = A059841(n) + A079978(n) + A079998(n).
a(n) = A001221(gcd(n, 30)).
a(n) = A001221(A355582(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 31/30. (End)

Extensions

Name edited by Amiram Eldar, Sep 16 2023
Showing 1-3 of 3 results.