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-10 of 15 results. Next

A000031 Number of n-bead necklaces with 2 colors when turning over is not allowed; also number of output sequences from a simple n-stage cycling shift register; also number of binary irreducible polynomials whose degree divides n.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 14, 20, 36, 60, 108, 188, 352, 632, 1182, 2192, 4116, 7712, 14602, 27596, 52488, 99880, 190746, 364724, 699252, 1342184, 2581428, 4971068, 9587580, 18512792, 35792568, 69273668, 134219796, 260301176, 505294128, 981706832
Offset: 0

Views

Author

Keywords

Comments

Also a(n)-1 is the number of 1's in the truth table for the lexicographically least de Bruijn cycle (Fredricksen).
In music, a(n) is the number of distinct classes of scales and chords in an n-note equal-tempered tuning system. - Paul Cantrell, Dec 28 2011
Also, minimum cardinality of an unavoidable set of length-n binary words (Champarnaud, Hansel, Perrin). - Jeffrey Shallit, Jan 10 2019
(1/n) * Dirichlet convolution of phi(n) and 2^n, n>0. - Richard L. Ollerton, May 06 2021
From Jianing Song, Nov 13 2021: (Start)
a(n) is even for n != 0, 2. Proof: write n = 2^e * s with odd s, then a(n) * s = Sum_{d|s} Sum_{k=0..e} phi((2^e*s)/(2^k*d)) * 2^(2^k*d-e) = Sum_{d|s} Sum_{k=0..e-1} phi(s/d) * 2^(2^k*d-k-1) + Sum_{d|s} phi(s/d) * 2^(2^e*d-e) == Sum_{k=0..e-1} 2^(2^k*s-k-1) + 2^(2^e*s-e) == Sum_{k=0..min{e-1,1}} 2^(2^k*s-k-1) (mod 2). a(n) is odd if and only if s = 1 and e-1 = 0, or n = 2.
a(n) == 2 (mod 4) if and only if n = 1, 4 or n = 2*p^e with prime p == 3 (mod 4).
a(n) == 4 (mod 8) if and only if n = 2^e, 3*2^e for e >= 3, or n = p^e, 4*p^e != 12 with prime p == 3 (mod 4), or n = 2s where s is an odd number such that phi(s) == 4 (mod 8). (End)

Examples

			For n=3 and n=4 the necklaces are {000,001,011,111} and {0000,0001,0011,0101,0111,1111}.
The analogous shift register sequences are {000..., 001001..., 011011..., 111...} and {000..., 00010001..., 00110011..., 0101..., 01110111..., 111...}.
		

References

  • S. W. Golomb, Shift-Register Sequences, Holden-Day, San Francisco, 1967, pp. 120, 172.
  • May, Robert M. "Simple mathematical models with very complicated dynamics." Nature, Vol. 261, June 10, 1976, pp. 459-467; reprinted in The Theory of Chaotic Attractors, pp. 85-93. Springer, New York, NY, 2004. The sequences listed in Table 2 are A000079, A027375, A000031, A001037, A000048, A051841. - N. J. A. Sloane, Mar 17 2019
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.112(a).

Crossrefs

Column 2 of A075195.
Cf. A001037 (primitive solutions to same problem), A014580, A000016, A000013, A000029 (if turning over is allowed), A000011, A001371, A058766.
Rows sums of triangle in A047996.
Dividing by 2 gives A053634.
A008965(n) = a(n) - 1 allowing different offsets.
Cf. A008965, A053635, A052823, A100447 (bisection).
Cf. A000010.

Programs

  • Haskell
    a000031 0 = 1
    a000031 n = (`div` n) $ sum $
       zipWith (*) (map a000010 divs) (map a000079 $ reverse divs)
       where divs = a027750_row n
    -- Reinhard Zumkeller, Mar 21 2013
    
  • Maple
    with(numtheory); A000031 := proc(n) local d,s; if n = 0 then RETURN(1); else s := 0; for d in divisors(n) do s := s+phi(d)*2^(n/d); od; RETURN(s/n); fi; end; [ seq(A000031(n), n=0..50) ];
  • Mathematica
    a[n_] := Sum[If[Mod[n, d] == 0, EulerPhi[d] 2^(n/d), 0], {d, 1, n}]/n
    a[n_] := Fold[#1 + 2^(n/#2) EulerPhi[#2] &, 0, Divisors[n]]/n (* Ben Branman, Jan 08 2011 *)
    Table[Expand[CycleIndex[CyclicGroup[n], t] /. Table[t[i]-> 2, {i, 1, n}]], {n,0, 30}] (* Geoffrey Critzer, Mar 06 2011*)
    a[0] = 1; a[n_] := DivisorSum[n, EulerPhi[#]*2^(n/#)&]/n; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Feb 03 2016 *)
    mx=40; CoefficientList[Series[1-Sum[EulerPhi[i] Log[1-2*x^i]/i,{i,1,mx}],{x,0,mx}],x] (*Herbert Kociemba, Oct 29 2016 *)
  • PARI
    {A000031(n)=if(n==0,1,sumdiv(n,d,eulerphi(d)*2^(n/d))/n)} \\ Randall L Rathbun, Jan 11 2002
    
  • Python
    from sympy import totient, divisors
    def A000031(n): return sum(totient(d)*(1<Chai Wah Wu, Nov 16 2022

Formula

a(n) = (1/n)*Sum_{ d divides n } phi(d)*2^(n/d) = A053635(n)/n, where phi is A000010.
Warning: easily confused with A001037, which has a similar formula.
G.f.: 1 - Sum_{n>=1} phi(n)*log(1 - 2*x^n)/n. - Herbert Kociemba, Oct 29 2016
a(0) = 1; a(n) = (1/n) * Sum_{k=1..n} 2^gcd(n,k). - Ilya Gutkovskiy, Apr 16 2021
a(0) = 1; a(n) = (1/n)*Sum_{k=1..n} 2^(n/gcd(n,k))*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 06 2021
Dirichlet g.f.: f(s+1) * (zeta(s)/zeta(s+1)), where f(s) = Sum_{n>=1} 2^n/n^s. - Jianing Song, Nov 13 2021

Extensions

There is an error in Fig. M3860 in the 1995 Encyclopedia of Integer Sequences: in the third line, the formula for A000031 = M0564 should be (1/n) sum phi(d) 2^(n/d).

A185651 A(n,k) = Sum_{d|n} phi(d)*k^(n/d); square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 6, 3, 0, 0, 4, 12, 12, 4, 0, 0, 5, 20, 33, 24, 5, 0, 0, 6, 30, 72, 96, 40, 6, 0, 0, 7, 42, 135, 280, 255, 84, 7, 0, 0, 8, 56, 228, 660, 1040, 780, 140, 8, 0, 0, 9, 72, 357, 1344, 3145, 4200, 2205, 288, 9, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Comments

Dirichlet convolution of phi(n) and k^n. - Richard L. Ollerton, May 07 2021

Examples

			Square array A(n,k) begins:
  0, 0,  0,   0,    0,     0,     0, ...
  0, 1,  2,   3,    4,     5,     6, ...
  0, 2,  6,  12,   20,    30,    42, ...
  0, 3, 12,  33,   72,   135,   228, ...
  0, 4, 24,  96,  280,   660,  1344, ...
  0, 5, 40, 255, 1040,  3145,  7800, ...
  0, 6, 84, 780, 4200, 15810, 46956, ...
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    A:= (n, k)-> add(phi(d)*k^(n/d), d=divisors(n)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    a[, 0] = a[0, ] = 0; a[n_, k_] := Sum[EulerPhi[d]*k^(n/d), {d, Divisors[n]}]; Table[a[n - k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Dec 06 2013 *)

Formula

A(n,k) = Sum_{d|n} phi(d)*k^(n/d).
A(n,k) = Sum_{i=0..min(n,k)} C(k,i) * i! * A258170(n,i). - Alois P. Heinz, May 22 2015
G.f. for column k: Sum_{n>=1} phi(n)*k*x^n/(1-k*x^n) for k >= 0. - Petros Hadjicostas, Nov 06 2017
From Richard L. Ollerton, May 07 2021: (Start)
A(n,k) = Sum_{i=1..n} k^gcd(n,i).
A(n,k) = Sum_{i=1..n} k^(n/gcd(n,i))*phi(gcd(n,i))/phi(n/gcd(n,i)).
A(n,k) = A075195(n,k)*n for n >= 1, k >= 1. (End)

A034738 Dirichlet convolution of b_n = 2^(n-1) with phi(n).

Original entry on oeis.org

1, 3, 6, 12, 20, 42, 70, 144, 270, 540, 1034, 2112, 4108, 8274, 16440, 32928, 65552, 131418, 262162, 524880, 1048740, 2098206, 4194326, 8391024, 16777300, 33558564, 67109418, 134226120, 268435484, 536888520, 1073741854, 2147516736
Offset: 1

Views

Author

Keywords

Comments

Sum of GCD's of parts in all compositions of n. - Vladeta Jovovic, Aug 13 2003
From Petros Hadjicostas, Dec 07 2017: (Start)
It also equals the sum of all lengths of all cyclic compositions of n. This was proved in Perez (2008).
The bivariate g.f. for the number b(n,k) of all cyclic of compositions of n with k parts is Sum_{n,k>=1} b(n,k)*x^n*y^k = -Sum_{s>=1} (phi(s)/s)*log(1 - y^s*Sum_{t>=1} x^{s*t}) = -Sum_{s>=1} (phi(s)/s)*log(1 - y^s*x^s/(1-x^s)). See, for example, Hadjicostas (2016). Differentiating w.r.t. y and setting y = 1, we get Sum_{n>=1} a(n)*x^n = Sum_{n>=1} (Sum_{k=1..n} b(n,k)*k)*x^n = Sum_{s>=1} phi(s)*x^s/(1-2*x^s).
(End)

Examples

			For the compositions of n=4 we have a(4) = gcd(4) + gcd(1,3) + gcd(3,1) + gcd(2,2) + gcd(2,1,1) + gcd(1,2,1) + gcd(1,1,2) + gcd(1,1,1,1) = 4 + 1 + 1 + 2 + 1 + 1 + 1 + 1 = 12. Also, for cyclic compositions of n=4, we have length(4) + length(1,3) + length(2,2) + length(1,1,2) + length(1,1,1,1) = 1 + 2 + 2 + 3 + 4 = 12.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[EulerPhi[d]*2^(n/d-1), {d, Divisors[n]}], {n, 1, 40}] (* Vaclav Kotesovec, Feb 07 2019 *)
  • PARI
    a(n) = sum(k=1, n, 2^(gcd(k, n)-1)); \\ Seiichi Manyama, Apr 17 2021
    
  • PARI
    a(n) = sumdiv(n, d, eulerphi(n/d)*2^(d-1)); \\ Seiichi Manyama, Apr 17 2021
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, eulerphi(k)*x^k/(1-2*x^k))) \\ Seiichi Manyama, Apr 17 2021

Formula

a(n) = A053635(n)/2.
a(n) = (1/2)* Sum_{d|n} phi(d)*2^(n/d), n >= 1.
G.f.: Sum_{s>=1} phi(s)*x^s/(1-2*x^s). - Petros Hadjicostas, Dec 07 2017
a(n) ~ 2^(n-1). - Vaclav Kotesovec, Feb 07 2019
a(n) = Sum_{k=1..n} 2^(gcd(k, n) - 1). - Seiichi Manyama, Apr 17 2021
a(n) = Sum_{k=1..n} 2^(n/gcd(n,k) - 1)*phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 06 2021

A053634 a(n) = Sum_{ d divides n } phi(d)*2^(n/d)/(2n).

Original entry on oeis.org

2, 3, 4, 7, 10, 18, 30, 54, 94, 176, 316, 591, 1096, 2058, 3856, 7301, 13798, 26244, 49940, 95373, 182362, 349626, 671092, 1290714, 2485534, 4793790, 9256396, 17896284, 34636834, 67109898, 130150588, 252647064, 490853416, 954440950
Offset: 3

Views

Author

N. J. A. Sloane, Mar 23 2000

Keywords

Comments

Offset is 3 because a(2) is 3/2, not an integer. - Michel Marcus, Sep 11 2013

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, EulerPhi[#]*2^(n/#)&]/(2n); Table[a[n], {n, 3, 36}] (* Jean-François Alcover, Dec 07 2015 *)
  • PARI
    a(n) = sumdiv (n, d, eulerphi(d)*2^(n/d)/(2*n));  \\ Michel Marcus, Sep 11 2013

Formula

a(n) = A000031(n)/2.

A053636 a(n) = Sum_{odd d|n} phi(d)*2^(n/d).

Original entry on oeis.org

0, 2, 4, 12, 16, 40, 72, 140, 256, 540, 1040, 2068, 4128, 8216, 16408, 32880, 65536, 131104, 262296, 524324, 1048640, 2097480, 4194344, 8388652, 16777728, 33554600, 67108912, 134218836, 268435552, 536870968, 1073744160, 2147483708
Offset: 0

Views

Author

N. J. A. Sloane, Mar 23 2000

Keywords

Examples

			2*x + 4*x^2 + 12*x^3 + 16*x^4 + 40*x^5 + 72*x^6 + 140*x^7 + 256*x^8 + 540*x^9 + ...
		

Crossrefs

Programs

  • Haskell
    a053636 0 = 0
    a053636 n = sum $ zipWith (*) (map a000010 ods) (map ((2 ^) . (div n)) ods)
                where ods = a182469_row n
    -- Reinhard Zumkeller, Sep 13 2013
    
  • Mathematica
    a[ n_] := If[ n < 1, 0, Sum[ Mod[ d, 2] EulerPhi[ d] 2^(n / d), {d, Divisors[ n]}]] (* Michael Somos, May 09 2013 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv( n, d, (d % 2) * eulerphi(d) * 2^(n / d)))} /* Michael Somos, May 09 2013 */
    
  • Python
    from sympy import totient, divisors
    def A053636(n): return (sum(totient(d)<>(~n&n-1).bit_length(),generator=True))<<1) # Chai Wah Wu, Feb 21 2023

Formula

a(n) = n * A063776(n).
a(n) = Sum_{k=1..A001227(n)} A000010(A182469(n,k)) * 2^(n/A182469(n, A001227(n)+1-k)). - Reinhard Zumkeller, Sep 13 2013
G.f.: Sum_{m >= 0} phi(2*m + 1)*2*x^(2*m + 1)/(1 - 2*x^(2*m + 1)). - Petros Hadjicostas, Jul 20 2019

A286237 Triangular table: T(n,k) = 0 if k does not divide n, otherwise T(n,k) = P(phi(k), n/k), where P is sequence A000027 used as a pairing function N x N -> N, and phi is Euler totient function, A000010. Table is read by rows as T(1,1), T(2,1), T(2,2), etc.

Original entry on oeis.org

1, 2, 1, 4, 0, 3, 7, 2, 0, 3, 11, 0, 0, 0, 10, 16, 4, 5, 0, 0, 3, 22, 0, 0, 0, 0, 0, 21, 29, 7, 0, 5, 0, 0, 0, 10, 37, 0, 8, 0, 0, 0, 0, 0, 21, 46, 11, 0, 0, 14, 0, 0, 0, 0, 10, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 67, 16, 12, 8, 0, 5, 0, 0, 0, 0, 0, 10, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 92, 22, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 21, 106, 0, 17, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36
Offset: 1

Views

Author

Antti Karttunen, May 05 2017

Keywords

Comments

Equally: square array A(n,k) = P(A000010(n), (n+k-1)/n) if n divides (n+k-1), 0 otherwise, read by descending antidiagonals as A(1,1), A(1,2), A(2,1), etc. Here P is sequence A000027 used as a pairing function N x N -> N.
When viewed as a triangular table, this sequence packs the values of phi(k) and quotient n/k (when it is integral) to a single value with the pairing function A000027. The two "components" can be accessed with functions A002260 & A004736, which allows us generate from this sequence various sums related to necklace enumeration (among other things).
For example, we have:
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 2^(A004736(a(i))) = A053635(n).
and
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 3^(A004736(a(i))) = A054610(n).

Examples

			The first fifteen rows of the triangle:
    1,
    2,  1,
    4,  0,  3,
    7,  2,  0,  3,
   11,  0,  0,  0, 10,
   16,  4,  5,  0,  0,  3,
   22,  0,  0,  0,  0,  0, 21,
   29,  7,  0,  5,  0,  0,  0, 10,
   37,  0,  8,  0,  0,  0,  0,  0, 21,
   46, 11,  0,  0, 14,  0,  0,  0,  0, 10,
   56,  0,  0,  0,  0,  0,  0,  0,  0,  0, 55,
   67, 16, 12,  8,  0,  5,  0,  0,  0,  0,  0, 10,
   79,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 78,
   92, 22,  0,  0,  0,  0, 27,  0,  0,  0,  0,  0,  0, 21,
  106,  0, 17,  0, 19,  0,  0,  0,  0,  0,  0,  0,  0,  0, 36
---------------------------------------------------------------
Note how triangle A286239 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order.
In the following examples: a = this sequence interpreted as a one-dimensional sequence, A = interpreted as a square array, T = interpreted as a triangular table, P = A000027 interpreted as a pairing function N x N -> N, phi = Euler totient function, A000010.
---
a(7) = A(1,4) = T(4,1) = P(phi(1),4/1) = P(1,4) = 1+(((1+4)^2 - 1 - (3*4))/2) = 7.
a(30) = A(2,7) = T(8,2) = P(phi(2),8/2) = P(1,4) (i.e., same as above) = 7.
a(10) = A(5,1) = T(5,5) = P(phi(5),5/5) = P(4,1) = 1+(((4+1)^2 - 4 - (3*1))/2) = 10.
a(110) = A(5,11) = T(15,5) = P(phi(5),15/5) = P(4,3) = 1+((4+3)^2 - 4 - (3*3))/2 = 19.
		

Crossrefs

Transpose: A286236.
Cf. A000124 (left edge of the triangle), A000217 (every number at the right edge is a triangular number).

Programs

  • Mathematica
    (* Based on Python script by Indranil Ghosh *)
    T[n_, m_] := ((n + m)^2 - n - 3*m + 2)/2
    t[n_, k_] := If[Mod[n, k] != 0, 0, T[EulerPhi[k], n/k]]
    Table[t[n, k], {n, 1, 20}, {k, 1, n}]
    (* David Radcliffe, Jun 12 2025 *)
  • Python
    from sympy import totient
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def t(n, k): return 0 if n%k!=0 else T(totient(k), n//k)
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 10 2017
  • Scheme
    (define (A286237 n) (A286237bi (A002260 n) (A004736 n)))
    (define (A286237bi row col) (if (not (zero? (modulo (+ row col -1) row))) 0 (let ((a (A000010 row)) (b (quotient (+ row col -1) row))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Alternatively, with triangular indexing:
    (define (A286237 n) (A286237tr (A002024 n) (A002260 n)))
    (define (A286237tr n k) (if (not (zero? (modulo n k))) 0 (let ((a (A000010 k)) (b (/ n k))) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    ;; Note that: (A286237tr n k) is equal to (A286237bi k (+ 1 (- n k))).
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
T(n,k) = 0 if k does not divide n, otherwise T(n,k) = (1/2)*(2 + ((A000010(k)+(n/k))^2) - A000010(k) - 3*(n/k)).
T(n,k) = A051731(n,k) * A286235(n,k).
Other identities. For all n >= 1:
T(prime(n),prime(n)) = A000217(prime(n)-1).

A286239 Triangular table: T(n,k) = 0 if k does not divide n, otherwise T(n,k) = P(A000010(n/k), k), where P is sequence A000027 used as a pairing function N x N -> N. Table is read by rows as T(1,1), T(2,1), T(2,2), etc.

Original entry on oeis.org

1, 1, 2, 3, 0, 4, 3, 2, 0, 7, 10, 0, 0, 0, 11, 3, 5, 4, 0, 0, 16, 21, 0, 0, 0, 0, 0, 22, 10, 5, 0, 7, 0, 0, 0, 29, 21, 0, 8, 0, 0, 0, 0, 0, 37, 10, 14, 0, 0, 11, 0, 0, 0, 0, 46, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 10, 5, 8, 12, 0, 16, 0, 0, 0, 0, 0, 67, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 21, 27, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 92, 36, 0, 19, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106
Offset: 1

Views

Author

Antti Karttunen, May 06 2017

Keywords

Comments

This sequence packs the values of phi(n/k) and k (whenever k divides n) to a single value, with the pairing function A000027. The two "components" can be accessed with functions A002260 & A004736, which allows us generate from this sequence various sums related to necklace enumeration (among other things).
For example, we have:
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 2^(A004736(a(i))) = A053635(n).
and
Sum_{i=A000217(n-1) .. A000217(n)} [a(i) > 0] * A002260(a(i)) * 3^(A004736(a(i))) = A054610(n)
Triangle A286237 has the same property.

Examples

			The first fifteen rows of triangle:
   1,
   1,  2,
   3,  0,  4,
   3,  2,  0,  7,
  10,  0,  0,  0, 11,
   3,  5,  4,  0,  0, 16,
  21,  0,  0,  0,  0,  0, 22,
  10,  5,  0,  7,  0,  0,  0, 29,
  21,  0,  8,  0,  0,  0,  0,  0, 37,
  10, 14,  0,  0, 11,  0,  0,  0,  0, 46,
  55,  0,  0,  0,  0,  0,  0,  0,  0,  0, 56,
  10,  5,  8, 12,  0, 16,  0,  0,  0,  0,  0, 67,
  78,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 79,
  21, 27,  0,  0,  0,  0, 22,  0,  0,  0,  0,  0,  0, 92,
  36,  0, 19,  0, 17,  0,  0,  0,  0,  0,  0,  0,  0,  0, 106
   -------------------------------------------------------------
Note how triangle A286237 contains on each row the same numbers in the same "divisibility-allotted" positions, but in reverse order.
		

Crossrefs

Transpose: A286238.
Cf. A000124 (the right edge of the triangle).

Programs

  • Python
    from sympy import totient
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)//2
    def t(n, k): return 0 if n%k!=0 else T(totient(n//k), k)
    for n in range(1, 21): print([t(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286239 n) (A286239tr (A002024 n) (A002260 n)))
    (define (A286239tr n k) (if (not (zero? (modulo n k))) 0 (let ((a (A000010 (/ n k))) (b k)) (* (/ 1 2) (+ (expt (+ a b) 2) (- a) (- (* 3 b)) 2)))))
    

Formula

As a triangle (with n >= 1, 1 <= k <= n):
T(n,k) = 0 if k does not divide n, otherwise T(n,k) = (1/2)*(2 + ((A000010(n/k)+k)^2) - A000010(n/k) - 3*k).

A161217 a(n) = Sum_{d|n} phi(n/d)^2*2^(d+1).

Original entry on oeis.org

0, 4, 12, 32, 56, 128, 192, 400, 640, 1232, 2304, 4496, 8608, 16960, 33456, 66304, 132096, 263168, 526320, 1049872, 2100352, 4196480, 8393904, 16779152, 33565952, 67111488, 134235840, 268441424, 536906720, 1073744960, 2147560704, 4294970896, 8590069760
Offset: 0

Views

Author

N. J. A. Sloane, Nov 21 2009

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) uses numtheory;
          add(phi(n/d)^2*2^(d+1), d=divisors(n))
        end:
    seq(a(n), n=0..32);  # Alois P. Heinz, Jun 24 2021
  • PARI
    a(n) = if (n, sumdiv(n, d, eulerphi(n/d)^2*2^(d+1)), 0); \\ Michel Marcus, Jun 24 2021

Formula

a(n) = 2*A160620(n). - Jon Maiga / Georg Fischer, Jun 22 2021

A258171 a(n) = Sum_{d|n} phi(d)*Bell(n/d) for n>0, a(0) = 0.

Original entry on oeis.org

0, 1, 3, 7, 19, 56, 214, 883, 4163, 21163, 116039, 678580, 4213848, 27644449, 190900217, 1382958677, 10480146333, 82864869820, 682076827740, 5832742205075, 51724158351527, 474869816158547, 4506715739125923, 44152005855084368, 445958869299027638
Offset: 0

Views

Author

Alois P. Heinz, May 22 2015

Keywords

Comments

Dirichlet convolution of phi(n) (A000010) and the Bell numbers (A000110) (n >= 1). - Richard L. Ollerton, May 09 2021

Crossrefs

Row sums of A258170.
Similar: A078392 (numbpart), this sequence (bell), A053635 (numbcomb), A181847 and A034738 (numbcomp), A327030 (numbperm).

Programs

  • Maple
    with(numtheory):
    A:= proc(n, k) option remember;
          add(phi(d)*k^(n/d), d=divisors(n))
        end:
    T:= (n, k)-> add((-1)^(k-i)*binomial(k, i)*A(n, i), i=0..k)/k!:
    a:= n-> add(T(n, k), k=0..n):
    seq(a(n), n=0..30);
  • Mathematica
    a[n_] := If[n == 0, 0, DivisorSum[n, EulerPhi[#] BellB[n/#] &]];
    Table[a[n], {n, 0, 25}] (* Peter Luschny, Aug 27 2019 *)

Formula

a(n) = Sum_{k=0..n} A258170(n,k).
For n >= 1, a(n) = Sum_{k=1..n} Bell(gcd(n,k)). - Richard L. Ollerton, May 09 2021

Extensions

New name from Peter Luschny, Aug 27 2019

A121775 T(n, k) = Sum_{d|n} phi(n/d)*binomial(d,k) for n>0, T(0, 0) = 1. Triangle read by rows, for 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 3, 5, 3, 1, 4, 8, 7, 4, 1, 5, 9, 10, 10, 5, 1, 6, 15, 20, 21, 15, 6, 1, 7, 13, 21, 35, 35, 21, 7, 1, 8, 20, 36, 60, 71, 56, 28, 8, 1, 9, 21, 42, 86, 126, 126, 84, 36, 9, 1, 10, 27, 59, 130, 215, 253, 210, 120, 45, 10, 1, 11, 21, 55, 165, 330, 462, 462, 330, 165, 55
Offset: 0

Views

Author

Paul D. Hanna, Aug 23 2006

Keywords

Comments

For n>0, (1/n)*Sum_{k=0..n} T(n,k)*(c-1)^k is the number of n-bead necklaces with c colors. See the cross references.

Examples

			Triangle begins:
[ 0]  1;
[ 1]  1,  1;
[ 2]  2,  3,  1;
[ 3]  3,  5,  3,   1;
[ 4]  4,  8,  7,   4,   1;
[ 5]  5,  9, 10,  10,   5,   1;
[ 6]  6, 15, 20,  21,  15,   6,   1;
[ 7]  7, 13, 21,  35,  35,  21,   7,   1;
[ 8]  8, 20, 36,  60,  71,  56,  28,   8,  1;
[ 9]  9, 21, 42,  86, 126, 126,  84,  36,  9,  1;
[10] 10, 27, 59, 130, 215, 253, 210, 120, 45, 10, 1;
		

Crossrefs

Cf. A053635 (row sums), A121776 (antidiagonal sums), A054630, A327029.
Cf. A000031 (c=2), A001867 (c=3), A001868 (c=4), A001869 (c=5), A054625 (c=6), A054626 (c=7), A054627 (c=8), A054628 (c=9), A054629 (c=10).

Programs

  • PARI
    T(n,k)=if(n
    				
  • SageMath
    # uses[DivisorTriangle from A327029]
    DivisorTriangle(euler_phi, binomial, 13) # Peter Luschny, Aug 24 2019
Showing 1-10 of 15 results. Next