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 14 results. Next

A000188 (1) Number of solutions to x^2 == 0 (mod n). (2) Also square root of largest square dividing n. (3) Also max_{ d divides n } gcd(d, n/d).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Shadow transform of the squares A000290. - Vladeta Jovovic, Aug 02 2002
Labos Elemer and Henry Bottomley independently proved that (2) and (3) define the same sequence. Bottomley also showed that (1) and (2) define the same sequence.
Proof that (2) = (3): Let max{gcd(d, n/d)} = K, then d = Kx, n/d = Ky so n = KKxy where xy is the squarefree part of n, otherwise K is not maximal. Observe also that g = gcd(K, xy) is not necessarily 1. Thus K is also the "maximal square-root factor" of n. - Labos Elemer, Jul 2000
We can write sqrt(n) = b*sqrt(c) where c is squarefree. Then b = A000188(n) is the "inner square root" of n, c = A007913(n) and b*c = A019554(n) = "outer square root" of n.

Examples

			a(8) = 2 because the largest square dividing 8 is 4, the square root of which is 2.
a(9) = 3 because 9 is a perfect square and its square root is 3.
a(10) = 1 because 10 is squarefree.
		

Crossrefs

Cf. A019554 (outer square root), A053150 (inner 3rd root), A019555 (outer 3rd root), A053164 (inner 4th root), A053166 (outer 4th root), A015052 (outer 5th root), A015053 (outer 6th root).
Cf. A240976 (Dgf at s=2).

Programs

  • Haskell
    a000188 n = product $ zipWith (^)
                          (a027748_row n) $ map (`div` 2) (a124010_row n)
    -- Reinhard Zumkeller, Apr 22 2012
    
  • Maple
    with(numtheory):A000188 := proc(n) local i: RETURN(op(mul(i,i=map(x->x[1]^floor(x[2]/2),ifactors(n)[2])))); end;
  • Mathematica
    Array[Function[n, Count[Array[PowerMod[#, 2, n ] &, n, 0 ], 0 ] ], 100]
    (* Second program: *)
    nMax = 90; sList = Range[Floor[Sqrt[nMax]]]^2; Sqrt[#] &/@ Table[ Last[ Select[ sList, Divisible[n, #] &]], {n, nMax}] (* Harvey P. Dale, May 11 2011 *)
    a[n_] := With[{d = Divisors[n]}, Max[GCD[d, Reverse[d]]]] (* Mamuka Jibladze, Feb 15 2015 *)
    f[p_, e_] := p^Floor[e/2]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 18 2020 *)
  • PARI
    a(n)=if(n<1,0,sum(i=1,n,i*i%n==0))
    
  • PARI
    a(n)=sqrtint(n/core(n)) \\ Zak Seidov, Apr 07 2009
    
  • PARI
    a(n)=core(n, 1)[2] \\ Michel Marcus, Feb 27 2013
    
  • Python
    from sympy.ntheory.factor_ import core
    from sympy import integer_nthroot
    def A000188(n): return integer_nthroot(n//core(n),2)[0] # Chai Wah Wu, Jun 14 2021

Formula

a(n) = n/A019554(n) = sqrt(A008833(n)).
a(n) = Sum_{d^2|n} phi(d), where phi is the Euler totient function A000010.
Multiplicative with a(p^e) = p^floor(e/2). - David W. Wilson, Aug 01 2001
Dirichlet series: Sum_{n >= 1} a(n)/n^s = zeta(2*s - 1)*zeta(s)/zeta(2*s), (Re(s) > 1).
Dirichlet convolution of A037213 and A008966. - R. J. Mathar, Feb 27 2011
Finch & Sebah show that the average order of a(n) is 3 log n/Pi^2. - Charles R Greathouse IV, Jan 03 2013
a(n) = sqrt(n/A007913(n)). - M. F. Hasler, May 08 2014
Sum_{n>=1} lambda(n)*a(n)*x^n/(1-x^n) = Sum_{n>=1} n*x^(n^2), where lambda() is the Liouville function A008836 (cf. A205801). - Mamuka Jibladze, Feb 15 2015
a(2*n) = a(n)*(A096268(n-1) + 1). - observed by Velin Yanev, Jul 14 2017, The formula says that a(2n) = 2*a(n) only when 2-adic valuation of n (A007814(n)) is odd, otherwise a(2n) = a(n). This follows easily from the definition (2). - Antti Karttunen, Nov 28 2017
Sum_{k=1..n} a(k) ~ 3*n*((log(n) + 3*gamma - 1)/Pi^2 - 12*zeta'(2)/Pi^4), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Dec 01 2020
Conjecture: a(n) = Sum_{k=1..n} A010052(n*k). - Velin Yanev, Jul 04 2021
G.f.: Sum_{k>=1} phi(k) * x^(k^2) / (1 - x^(k^2)). - Ilya Gutkovskiy, Aug 20 2021

Extensions

Edited by M. F. Hasler, May 08 2014

A205802 Expansion of e.g.f. 1/( Sum_{n>=0} (-x)^(n^2) / (n^2)! ).

Original entry on oeis.org

1, 1, 2, 6, 23, 110, 630, 4200, 31990, 274051, 2608220, 27304530, 311820630, 3857738170, 51397726380, 733698365400, 11171708347799, 180738402744866, 3096027531044102, 55980949167688884, 1065496642477438890, 21293801805033731190, 445818117237227995260
Offset: 0

Views

Author

Paul D. Hanna, Jan 31 2012

Keywords

Examples

			E.g.f.: A(x) = 1 + x + 2*x^2/2! + 6*x^3/3! + 23*x^4/4! + 110*x^5/5! + ...
where
1/A(x) = 1 - x + x^4/4! - x^9/9! + x^16/16! - x^25/25! + x^36/36! + ...
		

Crossrefs

Programs

  • PARI
    {a(n)=n!*polcoeff(sum(m=0, sqrtint(n+1), (-1)^m*x^(m^2)/(m^2)!+x*O(x^n))^(-1), n)}
    for(n=0,25,print1(a(n),", "))

Formula

E.g.f.: 1/( Sum_{n>=0} (-x)^(n^2) / (n^2)! ).

A273001 Number of permutations of [n] whose cycle lengths are Fibonacci numbers.

Original entry on oeis.org

1, 1, 2, 6, 18, 90, 420, 2220, 19020, 130860, 1096920, 9862920, 83843640, 1411202520, 16144792560, 203091829200, 2989264122000, 37012939750800, 597962683188000, 8681244913692000, 126467701221607200, 5006833609034743200, 95602098255580238400
Offset: 0

Views

Author

Alois P. Heinz, May 12 2016

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(
          `if`(issqr(5*j^2+4) or issqr(5*j^2-4),
           a(n-j)*(j-1)!*binomial(n-1, j-1), 0), j=1..n))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, Sum[If[IntegerQ @ Sqrt[5*j^2+4] || IntegerQ @ Sqrt[5*j^2-4], a[n-j]*(j-1)!*Binomial[n-1, j-1], 0], {j, 1, n}]]; Table[ a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 30 2017, translated from Maple *)

Formula

E.g.f.: exp(Sum_{n>=2} x^F(n)/F(n)) with F = A000045.

A317129 Number of permutations of [n] whose lengths of increasing runs are squares.

Original entry on oeis.org

1, 1, 1, 1, 2, 9, 40, 151, 571, 2897, 19730, 140190, 953064, 6708323, 54631552, 510143776, 4987278692, 49168919669, 505209884549, 5638095015594, 67921924172174, 852861260421398, 10992380368532792, 147296144926635359, 2082906807168675698, 30973237281668975230
Offset: 0

Views

Author

Alois P. Heinz, Jul 21 2018

Keywords

Examples

			a(3) = 1: 321.
a(4) = 2: 1234, 4321.
a(5) = 9: 12354, 12453, 13452, 21345, 23451, 31245, 41235, 51234, 54321.
		

Crossrefs

Programs

  • Maple
    g:= n-> `if`(issqr(n), 1, 0):
    b:= proc(u, o, t) option remember; `if`(u+o=0, g(t),
          `if`(g(t)=1, add(b(u-j, o+j-1, 1), j=1..u), 0)+
           add(b(u+j-1, o-j, t+1), j=1..o))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..27);
  • Mathematica
    g[n_] := If[IntegerQ@Sqrt[n], 1, 0];
    b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, g[t],
         If[g[t] == 1, Sum[b[u - j, o + j - 1, 1], {j, 1, u}], 0] +
         Sum[b[u + j - 1, o - j, t + 1], {j, 1, o}]];
    a[n_] := b[n, 0, 0];
    a /@ Range[0, 27] (* Jean-François Alcover, Mar 29 2021, after Alois P. Heinz *)

A205800 Expansion of e.g.f. exp( Sum_{n>=1} x^(n^2) ).

Original entry on oeis.org

1, 1, 1, 1, 25, 121, 361, 841, 21841, 547345, 4541041, 23292721, 169658281, 7550279881, 95230199065, 692107448761, 25431412450081, 563675083228321, 9791797014753121, 112525775579561185, 3370231071632996281, 65798618669268652441, 1345746844683430533961
Offset: 0

Views

Author

Paul D. Hanna, Jan 31 2012

Keywords

Examples

			E.g.f.: A(x) = 1 + x + x^2/2! + x^3/3! + 25*x^4/4! + 121*x^5/5! +...
where
log(A(x)) = x + x^4 + x^9 + x^16 + x^25 + x^36 + x^49 + x^64 +...
		

Crossrefs

Programs

  • Maple
    seq(coeff(series(factorial(n)*(exp(add(x^(k^2),k=1..n))),x,n+1), x, n), n = 0 .. 25); # Muniru A Asiru, Oct 23 2018
  • Mathematica
    With[{nn=30},CoefficientList[Series[Exp[Sum[x^n^2,{n,nn}]],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Apr 01 2020 *)
  • PARI
    {a(n)=n!*polcoeff(exp(sum(m=1, sqrtint(n+1), x^(m^2)+x*O(x^n))), n)}
    
  • PARI
    a(n) = if(n==0, 1, (n-1)!*sum(k=1, sqrtint(n), k^2*a(n-k^2)/(n-k^2)!)); \\ Seiichi Manyama, Apr 29 2022

Formula

E.g.f.: exp((theta_3(x) - 1)/2), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Oct 23 2018
a(0) = 1; a(n) = (n-1)! * Sum_{k=1..floor(sqrt(n))} k^2 * a(n-k^2)/(n-k^2)!. - Seiichi Manyama, Apr 29 2022

A273997 Number of endofunctions on [n] whose cycle lengths are squares.

Original entry on oeis.org

1, 1, 3, 16, 131, 1446, 19957, 329344, 6315129, 137942380, 3382214291, 92014156224, 2751300514987, 89701699067176, 3167429783609925, 120428877629249536, 4905431165356442993, 213120603686615692176, 9837426739843075654819, 480775495859934668704000
Offset: 0

Views

Author

Alois P. Heinz, Jun 06 2016

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local r, f, g;
          if n=0 then 1 else r, f, g:=0, 1, 3;
          while f<=n do r:= r+(f-1)!*b(n-f)*
             binomial(n-1, f-1); f, g:= f+g, g+2
          od; r fi
        end:
    a:= n-> add(b(j)*n^(n-j)*binomial(n-1, j-1), j=0..n):
    seq(a(n), n=0..20);
  • Mathematica
    b[n_] := b[n] = Module[{r, f, g}, If[n == 0, 1, {r, f, g} = {0, 1, 3}; While[f <= n, r = r + (f - 1)!*b[n - f]*Binomial[n - 1, f - 1]; {f, g} = {f + g, g + 2}]; r]];
    a[0] = 1; a[n_] := Sum[b[j]*n^(n - j)*Binomial[n - 1, j - 1], {j, 0, n}];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jun 06 2018, from Maple *)

A306831 Expansion of e.g.f. exp(Sum_{k>=1} x^(k^2)*(1 + x^(k^2))/k^2).

Original entry on oeis.org

1, 1, 3, 7, 31, 111, 601, 2773, 27777, 230401, 2484811, 22999791, 254852863, 2615840527, 29661610161, 321837060301, 5736337960321, 86729871740673, 2360637009669907, 39094827261418711, 883743994410948831, 14306422917625170991, 301121907924200191753
Offset: 0

Views

Author

Ilya Gutkovskiy, May 23 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 23; CoefficientList[Series[Exp[Sum[x^(k^2) (1 + x^(k^2))/k^2, {k, 1, nmax}]], {x, 0, nmax}], x] Range[0, nmax]!
    nmax = 23; CoefficientList[Series[Product[(1 - x^k)^((-1)^k LiouvilleLambda[k]/k), {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]!

Formula

E.g.f.: Product_{k>=1} (1 - x^k)^((-1)^k*lambda(k)/k), where lambda() is the Liouville function (A008836).

A329256 Expansion of e.g.f. exp(Sum_{k>=1} x^(k^2) / (k^2)!).

Original entry on oeis.org

1, 1, 1, 1, 2, 6, 16, 36, 106, 443, 1796, 6161, 23816, 122266, 643644, 2934296, 14002237, 83835433, 532282819, 3005258539, 17039094646, 115611682810, 848428608644, 5682350940168, 37297365940462, 281594230420802, 2323660209441962, 17929392395804072
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 09 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 27; CoefficientList[Series[Exp[Sum[x^(k^2)/(k^2)!, {k, 1, Floor[nmax^(1/2)] + 1}]], {x, 0, nmax}], x] Range[0, nmax]!
    a[n_] := a[n] = Sum[Binomial[n - 1, k - 1] Boole[IntegerQ[k^(1/2)]] a[n - k], {k, 1, n}]; a[0] = 1; Table[a[n], {n, 0, 27}]
  • PARI
    my(N=30, x='x+O('x^N)); Vec(serlaplace(exp(sum(k=1, sqrtint(N), x^k^2/(k^2)!)))) \\ Seiichi Manyama, Apr 29 2022
    
  • PARI
    a(n) = if(n==0, 1, sum(k=1, sqrtint(n), binomial(n-1, k^2-1)*a(n-k^2))); \\ Seiichi Manyama, Apr 29 2022

Formula

a(0) = 1; a(n) = Sum_{k=1..n} binomial(n-1,k-1) * A010052(k) * a(n-k).

A308397 Expansion of e.g.f. exp(Sum_{k>=1} x^(k^2)*(1 - x^(k^2))/k^2).

Original entry on oeis.org

1, 1, -1, -5, 7, 71, -59, -1511, -9295, -1583, 861751, 4039091, -80670281, -606807785, 7674244397, 78614840641, 1146707474401, 12874145737889, -1054507266321425, -19048413877999253, 238097060642380391, 6646823785301856871, -59731575523361439851, -2231444370433747995415
Offset: 0

Views

Author

Ilya Gutkovskiy, May 24 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 23; CoefficientList[Series[Exp[Sum[x^(k^2) (1 - x^(k^2))/k^2, {k, 1, nmax}]], {x, 0, nmax}], x] Range[0, nmax]!
    nmax = 23; CoefficientList[Series[Product[(1 + x^k)^(LiouvilleLambda[k]/k), {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]!

Formula

E.g.f.: Product_{k>=1} (1 + x^k)^(lambda(k)/k), where lambda() is the Liouville function (A008836).

A329945 Number of permutations of [n] whose cycle lengths avoid squares.

Original entry on oeis.org

1, 0, 1, 2, 3, 44, 175, 1434, 12313, 59912, 1057761, 9211850, 118785931, 1702959972, 21390805423, 339381890834, 4027183717425, 89818053205904, 1477419923299393, 28377482210884242, 608128083110593171, 11954214606663753500, 269933818505222203311
Offset: 0

Views

Author

Alois P. Heinz, Nov 24 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, add(`if`(issqr(j), 0,
          a(n-j)*binomial(n-1, j-1)*(j-1)!), j=1..n))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_] := a[n] = If[n == 0, 1, Sum[If[IntegerQ@Sqrt[j], 0,
         a[n-j] Binomial[n-1, j-1] (j-1)!], {j, 1, n}]];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Oct 31 2021, after Alois P. Heinz *)

Formula

a(n) mod 2 = 1 - (n mod 2) = A059841(n).
a(n) mod 10 = period 10: repeat [1,0,1,2,3,4,5,4,3,2] = A271751(n-1) for n>0.
Showing 1-10 of 14 results. Next