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 10 results.

A080512 a(n) = n if n is odd, a(n) = 3*n/2 if n is even.

Original entry on oeis.org

1, 3, 3, 6, 5, 9, 7, 12, 9, 15, 11, 18, 13, 21, 15, 24, 17, 27, 19, 30, 21, 33, 23, 36, 25, 39, 27, 42, 29, 45, 31, 48, 33, 51, 35, 54, 37, 57, 39, 60, 41, 63, 43, 66, 45, 69, 47, 72, 49, 75, 51, 78, 53, 81, 55, 84, 57, 87, 59, 90, 61, 93, 63, 96, 65, 99, 67, 102
Offset: 1

Views

Author

Amarnath Murthy, Mar 20 2003

Keywords

Comments

First differences of the generalized heptagonal numbers A085787. - Omar E. Pol, Sep 10 2011
Last term in n-th row of A080511.
Also A005408 and positive terms of A008585 interleaved. - Omar E. Pol, May 28 2012
a(n) is also the length of the n-th line segment of the rectangular spiral whose vertices are the generalized heptagonal numbers. - Omar E. Pol, Jul 27 2018

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a080512 n = if m == 0 then 3 * n' else n  where (n', m) = divMod n 2
    a080512_list = concat $ transpose [[1, 3 ..], [3, 6 ..]]
    -- Reinhard Zumkeller, Apr 06 2015
  • Magma
    [n*(5+(-1)^n)/4: n in [1..60]]; // Vincenzo Librandi, Sep 11 2011
    
  • Mathematica
    Table[If[EvenQ[n],3n/2,n],{n,68}] (* Jayanta Basu, May 20 2013 *)

Formula

a(n) = n if n is odd, a(n) = 3*n/2 if n is even.
a(n)*a(n+3) = -3 + a(n+1)*a(n+2).
From Paul Barry, Sep 04 2003: (Start)
G.f.: (1+3*x+x^2)/((1-x^2)^2);
a(n) = n*(5 + (-1)^n)/4. (End)
Multiplicative with a(2^e) = 3*2^(e-1), a(p^e) = p^e otherwise. - Christian G. Bower, May 17 2005
Equals A126988 * (1, 1, 0, 0, 0, ...) - Gary W. Adamson, Apr 17 2007
Dirichlet g.f.: zeta(s-1) * (1 + 1/2^s). - Amiram Eldar, Oct 25 2023
Sum_{d divides n} mu(n/d)*a(d) = A126246(n), where mu(n) = A008683(n) is the Möbius function. - Peter Bala, Dec 31 2023

A384039 The number of integers k from 1 to n such that gcd(n,k) is a powerful number.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 6, 7, 4, 10, 6, 12, 6, 8, 12, 16, 7, 18, 12, 12, 10, 22, 12, 21, 12, 21, 18, 28, 8, 30, 24, 20, 16, 24, 21, 36, 18, 24, 24, 40, 12, 42, 30, 28, 22, 46, 24, 43, 21, 32, 36, 52, 21, 40, 36, 36, 28, 58, 24, 60, 30, 42, 48, 48, 20, 66, 48, 44
Offset: 1

Views

Author

Amiram Eldar, May 18 2025

Keywords

Comments

The number of integers k from 1 to n such that the powerfree part (A055231) of gcd(n,k) is 1.

Crossrefs

The number of integers k from 1 to n such that gcd(n,k) is: A026741 (odd), A062570 (power of 2), A063659 (squarefree), A078429 (cube), A116512 (power of a prime), A117494 (prime), A126246 (1 or 2), A206369 (square), A254926 (cubefree), A372671 (3-smooth), this sequence (powerful), A384040 (cubefull), A384041 (exponentially odd), A384042 (5-rough).

Programs

  • Mathematica
    f[p_, e_] := If[e == 1, p-1, (p^2-p+1)*p^(e-2)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,2] == 1, f[i,1]-1, (f[i,1]^2-f[i,1]+1)*f[i,1]^(f[i,2]-2)));}

Formula

Multiplicative with a(p^e) = (p^2-p+1)*p^(e-2) if e >= 2, and p-1 otherwise.
a(n) >= A000010(n), with equality if and only if n is squarefree (A005117).
Dirichlet g.f.: zeta(s-1) * Product_{p prime} (1 - 1/p^s + 1/p^(2*s)).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 1/p^2 + 1/p^4) = 0.66922021803510257394... .

A384040 The number of integers k from 1 to n such that gcd(n,k) is a cubefull number.

Original entry on oeis.org

1, 1, 2, 2, 4, 2, 6, 5, 6, 4, 10, 4, 12, 6, 8, 10, 16, 6, 18, 8, 12, 10, 22, 10, 20, 12, 19, 12, 28, 8, 30, 20, 20, 16, 24, 12, 36, 18, 24, 20, 40, 12, 42, 20, 24, 22, 46, 20, 42, 20, 32, 24, 52, 19, 40, 30, 36, 28, 58, 16, 60, 30, 36, 40, 48, 20, 66, 32, 44, 24
Offset: 1

Views

Author

Amiram Eldar, May 18 2025

Keywords

Comments

The number of integers k from 1 to n such that the cubefree part (A360539) of gcd(n,k) is 1.

Crossrefs

The number of integers k from 1 to n such that gcd(n,k) is: A026741 (odd), A062570 (power of 2), A063659 (squarefree), A078429 (cube), A116512 (power of a prime), A117494 (prime), A126246 (1 or 2), A206369 (square), A254926 (cubefree), A372671 (3-smooth), A384039 (powerful), this sequence (cubefull), A384041 (exponentially odd), A384042 (5-rough).

Programs

  • Mathematica
    f[p_, e_] := Switch[e, 1, p-1, 2, p^2-p, , (p^3-p^2+1)*p^(e-3)]; a[1] = 1; a[n] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,2] == 1, f[i,1]-1, if(f[i,2] == 2, f[i,1]*(f[i,1]-1), (f[i,1]^3-f[i,1]^2+1)*f[i,1]^(f[i,2]-3))));}

Formula

Multiplicative with a(p^e) = (p^3-p^2+1)*p^(e-3) if e >= 3, p*(p-1) if e = 2, and p-1 otherwise.
a(n) >= A384039(n), with equality if and only if n is squarefree (A005117).
Dirichlet g.f.: zeta(s-1) * Product_{p prime} (1 - 1/p^s + 1/p^(3*s)).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 1/p^2 + 1/p^6) = 0.62159731307414305346... .

A384041 The number of integers k from 1 to n such that gcd(n,k) is an exponentially odd number.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 7, 8, 10, 11, 9, 13, 14, 15, 13, 17, 16, 19, 15, 21, 22, 23, 21, 24, 26, 25, 21, 29, 30, 31, 27, 33, 34, 35, 24, 37, 38, 39, 35, 41, 42, 43, 33, 40, 46, 47, 39, 48, 48, 51, 39, 53, 50, 55, 49, 57, 58, 59, 45, 61, 62, 56, 53, 65, 66, 67, 51
Offset: 1

Views

Author

Amiram Eldar, May 18 2025

Keywords

Crossrefs

The number of integers k from 1 to n such that gcd(n,k) is: A026741 (odd), A062570 (power of 2), A063659 (squarefree), A078429 (cube), A116512 (power of a prime), A117494 (prime), A126246 (1 or 2), A206369 (square), A254926 (cubefree), A372671 (3-smooth), A384039 (powerful), A384040 (cubefull), this sequence (exponentially odd), A384042 (5-rough).

Programs

  • Mathematica
    f[p_, e_] := ((p^2+p-1)*p^(e-1) - (-1)^e)/(p+1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, ((f[i,1]^2+f[i,1]-1)*f[i,1]^(f[i,2]-1) - (-1)^f[i,2])/(f[i,1] + 1));}

Formula

Multiplicative with a(p^e) = ((p^2+p-1)*p^(e-1) - (-1)^e)/(p+1).
a(n) >= A000010(n), with equality if and only if n = 1.
Dirichlet g.f.: (zeta(s-1)*zeta(2*s)/zeta(s)) * Product_{p prime} (1 + 1/p^s - 1/p^(3*s)).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 1/p^2 + 1/(p^2+1)) = 0.93749428273130025078... .

A384042 The number of integers k from 1 to n such that gcd(n,k) is a 5-rough number (A007310).

Original entry on oeis.org

1, 1, 2, 2, 5, 2, 7, 4, 6, 5, 11, 4, 13, 7, 10, 8, 17, 6, 19, 10, 14, 11, 23, 8, 25, 13, 18, 14, 29, 10, 31, 16, 22, 17, 35, 12, 37, 19, 26, 20, 41, 14, 43, 22, 30, 23, 47, 16, 49, 25, 34, 26, 53, 18, 55, 28, 38, 29, 59, 20, 61, 31, 42, 32, 65, 22, 67, 34, 46
Offset: 1

Views

Author

Amiram Eldar, May 18 2025

Keywords

Crossrefs

The number of integers k from 1 to n such that gcd(n,k) is: A026741 (odd), A062570 (power of 2), A063659 (squarefree), A078429 (cube), A116512 (power of a prime), A117494 (prime), A126246 (1 or 2), A206369 (square), A254926 (cubefree), A372671 (3-smooth), A384039 (powerful), A384040 (cubefull), A384041 (exponentially odd), this sequence (5-rough).

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, (p-1)*p^(e-1), p^e]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,1] < 5, (f[i,1]-1)*f[i,1]^(f[i,2]-1), f[i,1]^f[i,2]));}

Formula

Multiplicative with a(p^e) = (p-1)*p^(e-1) if p <= 3 and p^e if p >= 5.
a(n) >= A000010(n), with equality if and only if n is 3-smooth (A003586).
a(n) = A000010(A065331(n)) * A065330(n).
a(n) = 2 * n * phi(n)/phi(6*n) = n * A000010(n) / A372671(n).
Dirichlet g.f.: zeta(s-1) * (1-1/2^s) * (1-1/3^s).
Sum_{k=1..n} a(k) ~ n^2 / 3.

A385195 The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is either 1 or 2.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 6, 7, 8, 8, 10, 6, 12, 12, 8, 15, 16, 16, 18, 12, 12, 20, 22, 14, 24, 24, 26, 18, 28, 16, 30, 31, 20, 32, 24, 24, 36, 36, 24, 28, 40, 24, 42, 30, 32, 44, 46, 30, 48, 48, 32, 36, 52, 52, 40, 42, 36, 56, 58, 24, 60, 60, 48, 63, 48, 40, 66, 48, 44
Offset: 1

Views

Author

Amiram Eldar, Jun 21 2025

Keywords

Examples

			For n = 6, the greatest divisor of k that is a unitary divisor of 6 for k = 1 to 6 is 1, 2, 3, 2, 1 and 6, respectively. 4 of the values are either 1 or 2, and therefore a(6) = 4.
		

Crossrefs

The unitary analog of A126246 (with respect to the definition "the number of integers k from 1 to n such that gcd(n,k) is either 1 or 2").
The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is: A047994 (1), A384048 (squarefree), A384049 (cubefree), A384050 (powerful), A384051 (cubefull), A384052 (square), A384053 (cube), A384054 (exponentially odd), A384055 (odd), A384056 (power of 2), A384057 (3-smooth), A384058 (5-rough), this sequence (1 or 2), A385196 (prime), A385197 (noncomposite), A385198 (prime power), A385199 (1 or prime power).

Programs

  • Mathematica
    f[p_, e_] := p^e - 1; f[2, 1] = 2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~,f[i,1]^f[i,2] - if(f[i,1] == 2 && f[i,2] == 1, 0, 1));}

Formula

Multiplicative with a(p^e) = 2 if p = 2 and e = 1, and p^e - 1 otherwise.
In general, the number of integers k from 1 to n such that ugcd(n, k), the greatest divisor of k that is a unitary divisor of n, is either 1 or a prime power q is a multiplicative function f(n) with f(p^e) = q if p^e = q, and p^e - 1 otherwise.
a(n) = A138191(n) * A047994(n), i.e., a(n) = 2*A047994(n) if n == 2 (mod 4) and A047994(n) otherwise.
In general, the number of integers k from 1 to n such that ugcd(n, k) is either 1 or a prime power q is (q/(q-1))*A047994(n) if q is a unitary divisor of n, and A047994(n) otherwise.
Sum_{k=1..n} a(k) ~ (23/40) * c * n^2, where c = Product_{p prime} (1 - 1/(p*(p+1))) = A065463.
In general, the average order of the number of integers k from 1 to n such that ugcd(n, k) is either 1 or a prime p is ((p^4+p^3-1)/(p^4+p^3-p^2)) * c * n^2 / 2, where c = A065463.

A129479 Triangle read by rows: A054523 * A097806 as infinite lower triangular matrices.

Original entry on oeis.org

1, 2, 1, 2, 1, 1, 3, 1, 1, 1, 4, 0, 0, 1, 1, 4, 3, 1, 0, 1, 1, 6, 0, 0, 0, 0, 1, 1, 6, 2, 1, 1, 0, 0, 1, 1, 6, 2, 2, 0, 0, 0, 0, 1, 1, 8, 4, 0, 1, 1, 0, 0, 0, 1, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 6, 4, 4, 2, 1, 1, 0, 0, 0, 0, 1, 1, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
Offset: 1

Views

Author

Gary W. Adamson, Apr 17 2007

Keywords

Examples

			First few rows of the triangle:
  1;
  2, 1;
  2, 1, 1;
  3, 1, 1, 1;
  4, 0, 0, 1, 1;
  4, 3, 1, 0, 1, 1;
  6, 0, 0, 0, 0, 1, 1;
  6, 2, 1, 1, 0, 0, 1, 1;
  ...
		

Crossrefs

Cf. A000010 (alternating row sums), A053158 (row sums).

Programs

  • Magma
    A054523:= func< n,k | n eq 1 select 1 else (n mod k) eq 0 select EulerPhi(Floor(n/k)) else 0 >;
    A129479:= func< n,k | k le n-1 select A054523(n,k) + A054523(n,k+1) else 1 >;
    [A129479(n,k): k in [1..n], n in [1..16]]; // G. C. Greubel, Feb 11 2024
    
  • Mathematica
    A054523[n_, k_]:= If[n==1, 1, If[Divisible[n,k], EulerPhi[n/k], 0]];
    T[n_, k_]:= If[kA054523[n, j+k], {j,0,1}], 1];
    Table[T[n,k],{n,16},{k,n}]//Flatten (* G. C. Greubel, Feb 11 2024 *)
  • SageMath
    def A054523(n,k):
        if (k==n): return 1
        elif (n%k): return 0
        else: return euler_phi(n//k)
    def A129479(n, k):
        if k<0 or k>n: return 0
        elif k==n: return 1
        else: return A054523(n,k) + A054523(n,k+1)
    flatten([[A129479(n, k) for k in range(1,n+1)] for n in range(1,17)]) # G. C. Greubel, Feb 11 2024

Formula

Sum_{k=1..n} T(n, k) = A053158(n) (row sums).
T(n, 1) = A126246(n).
From G. C. Greubel, Feb 11 2024: (Start)
T(n, k) = A054523(n, k) + A054523(n, k+1) for k < n, otherwise 1.
T(2*n-1, n) = A019590(n).
T(2*n, n) = A054977(n).
T(2*n+1, n) = A000038(n).
T(3*n, n) = A063524(n-1).
T(3*n-2, n) = A183918(n+2).
Sum_{k=1..n} (-1)^(k-1) * T(n, k) = A000010(n). (End)

A128317 Triangle read by rows: T = A054523 * A130595, as a lower triangular matrix.

Original entry on oeis.org

1, 0, 1, 3, -2, 1, 0, 4, -3, 1, 5, -4, 6, -4, 1, 0, 5, -9, 10, -5, 1, 7, -6, 15, -20, 15, -6, 1, 0, 12, -24, 36, -35, 21, -7, 1, 9, -12, 30, -56, 70, -56, 28, -8, 1, 0, 9, -30, 80, -125, 126, -84, 36, -9, 1, 11, -10, 45, -120, 210, -252, 210, -120, 45, -10, 1
Offset: 1

Views

Author

Gary W. Adamson, Feb 25 2007

Keywords

Examples

			First few rows of the triangle:
  1;
  0,  1;
  3, -2,  1;
  0,  4, -3,   1;
  5, -4,  6,  -4,  1;
  0,  5, -9,  10, -5,  1;
  7, -6, 15, -20, 15, -6, 1;
  ...
		

Crossrefs

Sums include: A000010 (row sums), A126246.

Programs

  • Magma
    A128317:= func< n,k | (&+[(-1)^(d+k)*EulerPhi(Floor(n/d))*Binomial(d-1, k-1) : d in Divisors(n)]) >;
    [A128317(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Jun 24 2024
    
  • Mathematica
    A128317[n_, k_]:= DivisorSum[n, (-1)^(#+k)*EulerPhi[n/#]*Binomial[#-1, k-1]  &];
    Table[A128317[n,k], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Jun 24 2024 *)
  • SageMath
    def A128317(n,k): return sum((-1)^(k+j)*euler_phi(n/j)*binomial(j-1, k-1) for j in (1..n) if (j).divides(n))
    flatten([[A128317(n,k) for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Jun 24 2024

Formula

Equals A054523 * signed A007318 as infinite lower triangular matrices. A007318 is signed by columns: (+, -, +, ...).
Sum_{k=1..n} T(n, k) = A000010(n) (row sums).
From G. C. Greubel, Jun 24 2024: (Start)
T(n, k) = A054523 * A130595, as a lower triangular matrix.
T(n, k) = Sum_{j=k..n} (-1)^(k+j)*A054523(n,j)*binomial(j-1, k-1).
T(n, k) = Sum_{d|n} (-1)^(d+k)*EulerPhi(n/d)*binomial(d-1, k-1).
T(2*n-1, n) = (-1)^(n-1)*A000984(n-1), n >= 1.
T(2*n-2, n-1) = (-1)^n*A001700(n-2), n >= 2.
Sum_{k=1..n} k*T(n, k) = A126246(n). (End)

A209974 a(n) = A209973(n)/4.

Original entry on oeis.org

0, 0, 3, 5, 9, 13, 19, 25, 33, 39, 51, 61, 69, 81, 99, 107, 123, 139, 157, 175, 191, 203, 233, 255, 271, 291, 327, 345, 369, 397, 421, 451, 483, 503, 551, 575, 599, 635, 689, 713, 745, 785, 821, 863, 903, 927, 993, 1039, 1071, 1113, 1173
Offset: 0

Views

Author

Clark Kimberling, Mar 16 2012

Keywords

Comments

For a guide to related sequences, see A210000.

Crossrefs

Programs

  • Mathematica
    (See the Mathematica section at A210000.)

Formula

Apparently, a(n) = a(n-1) + 2*A126246(n) - A000010(n) for n >= 2. - Pontus von Brömssen, Jun 28 2021

A346018 Triangle read by rows: T(n,k) is the number of integers m such that 1 <= m <= n and gcd(m,n) <= k, 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 2, 3, 3, 4, 4, 4, 4, 4, 5, 2, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 4, 6, 6, 7, 7, 7, 7, 8, 6, 6, 8, 8, 8, 8, 8, 8, 9, 4, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 4, 6, 8, 10, 10, 11, 11, 11, 11, 11, 11, 12
Offset: 1

Views

Author

Pontus von Brömssen, Jul 01 2021

Keywords

Examples

			Triangle begins:
   n\k  1  2  3  4  5  6  7  8  9 10
  ----------------------------------
   1:   1
   2:   1  2
   3:   2  2  3
   4:   2  3  3  4
   5:   4  4  4  4  5
   6:   2  4  5  5  5  6
   7:   6  6  6  6  6  6  7
   8:   4  6  6  7  7  7  7  8
   9:   6  6  8  8  8  8  8  8  9
  10:   4  8  8  8  9  9  9  9  9 10
		

Crossrefs

Cf. A000010 (column k=1), A126246 (column k=2), A032742.

Programs

  • PARI
    T(n,k) = sum(m=1, n, gcd(m, n) <= k); \\ Michel Marcus, Jul 01 2021

Formula

T(n,1) = A000010(n).
T(n,2) = A126246(n).
T(n,k) = n-1 for A032742(n) <= k <= n-1.
T(n,n) = n.
Showing 1-10 of 10 results.