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

A057562 Number of partitions of n into parts all relatively prime to n.

Original entry on oeis.org

1, 1, 2, 2, 6, 2, 14, 6, 16, 7, 55, 6, 100, 17, 44, 32, 296, 14, 489, 35, 178, 77, 1254, 30, 1156, 147, 731, 142, 4564, 25, 6841, 390, 1668, 474, 4780, 114, 21636, 810, 4362, 432, 44582, 103, 63260, 1357, 4186, 2200, 124753, 364, 105604, 1232, 24482, 3583
Offset: 1

Views

Author

Leroy Quet, Oct 03 2000

Keywords

Comments

p is prime iff a(p) = A000041(p)-1. - Lior Manor, Feb 04 2005

Examples

			The unrestricted partitions of 4 are 1+1+1+1, 1+1+2, 1+3, 2+2 and 4. Of these, only 1+1+1+1 and 1+3 contain parts which are all relatively prime to 4. So a(4) = 2.
		

Crossrefs

See also A098743 (parts don't divide n).

Programs

  • Haskell
    a057562 n = p (a038566_row n) n where
       p _          0 = 1
       p []         _ = 0
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jul 05 2013
  • Mathematica
    Table[Count[IntegerPartitions@ n, k_ /; AllTrue[k, CoprimeQ[#, n] &]], {n, 52}] (* Michael De Vlieger, Aug 01 2017 *)
  • PARI
    R(n, v)=if(#v<2 || n=0, sum(i=1, #v, R(n-v[i], v[1..i])))
    a(n)=if(isprime(n), return(numbpart(n)-1)); R(n, select(k->gcd(k, n)==1, vector(n, i, i))) \\ Charles R Greathouse IV, Sep 13 2012
    
  • PARI
    a(n)=polcoeff(1/prod(k=1,n,if(gcd(k,n)==1,1-x^k,1), O(x^(n+1))+1), n) \\ Charles R Greathouse IV, Sep 13 2012
    

Formula

Coefficient of x^n in expansion of 1/Product_{d : gcd(d, n)=1} (1-x^d). - Vladeta Jovovic, Dec 23 2004

Extensions

More terms from Naohiro Nomoto, Feb 28 2002
Corrected by Vladeta Jovovic, Dec 23 2004

A079124 Number of ways to partition n into distinct positive integers <= phi(n), where phi is Euler's totient function (A000010).

Original entry on oeis.org

1, 1, 0, 1, 0, 2, 0, 4, 1, 5, 1, 11, 0, 17, 4, 13, 13, 37, 2, 53, 13, 51, 35, 103, 10, 135, 78, 167, 89, 255, 4, 339, 253, 378, 306, 542, 121, 759, 558, 872, 498, 1259, 121, 1609, 1180, 1677, 1665, 2589, 808, 3250, 1969, 3844, 3325, 5119, 1850, 6268, 4758, 7546, 7070
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 27 2002

Keywords

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education, Vol. 31, No. 1, pp. 24-28, Winter 1997. MathEduc Database (Zentralblatt MATH, 1997c.01891).

Crossrefs

Programs

  • Haskell
    a079124 n = p [1 .. a000010 n] n where
       p _      0 = 1
       p []     _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
    -- Reinhard Zumkeller, Jul 05 2013
  • Maple
    with(numtheory):
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<1, 0, b(n, i-1)+`if`(i>n, 0, b(n-i, i-1))))
        end:
    a:= n-> b(n, phi(n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, May 11 2015
  • Mathematica
    b[n_, i_] := b[n, i] = If[n==0, 1, If[i<1, 0, b[n, i-1] + If[i>n, 0, b[n-i, i-1]]]]; a[n_] := b[n, EulerPhi[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jun 30 2015, after Alois P. Heinz *)

Formula

a(n) = b(0, n), b(m, n) = 1 + sum(b(i, j): m

Extensions

a(0)=1 prepended by Alois P. Heinz, May 11 2015

A083290 Number of partitions of n into distinct parts which are coprime to n and which are also pairwise relatively prime.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 3, 2, 3, 2, 7, 2, 9, 3, 4, 5, 16, 3, 20, 4, 8, 7, 31, 5, 22, 9, 18, 9, 54, 4, 68, 16, 21, 16, 28, 11, 112, 20, 32, 18, 144, 9, 173, 22, 33, 40, 221, 19, 139, 25, 71, 43, 327, 25, 117, 47, 103, 80, 475, 18, 568, 90, 98, 122, 191, 29, 805, 93, 197, 44
Offset: 1

Author

Reinhard Zumkeller, Apr 23 2003

Keywords

Comments

a(n) <= A036998(n); see A082415 for numbers m with a(m) = A036998(m).

Examples

			a(7) = 3 since 7 = 3+4 = 2+5 = 1+6; 7 = 1+2+4 does not count (A036998(7)=4).
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, Module[{ip}, ip = IntegerPartitions[n, All, Select[Range[n - 1], CoprimeQ[#, n] &]]; Length@Select[ip, Sort[#] == Union[#] && AllTrue[Subsets[#, {2}], CoprimeQ @@ # &] &]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 80}] (* Jean-François Alcover, Dec 12 2021 *)
  • PARI
    a(n)={local(Cache=Map()); my(recurse(r,p,k)=my(hk=[r,p,k],z); if(!mapisdefined(Cache,hk,&z), z=if(k==0, r==0, self()(r,p,k-1) + if(gcd(p,k)==1, self()(r-k, p*k, min(r-k,k-1)))); mapput(Cache, hk, z)); z); recurse(n,n,n)} \\ Andrew Howroyd, Apr 20 2021

Extensions

Terms a(31) and beyond from Andrew Howroyd, Apr 20 2021

A331887 Number of partitions of n into distinct parts having a common factor > 1 with n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 3, 1, 5, 1, 5, 4, 6, 1, 11, 1, 11, 6, 12, 1, 23, 3, 18, 8, 23, 1, 69, 1, 32, 13, 38, 7, 84, 1, 54, 19, 79, 1, 224, 1, 90, 46, 104, 1, 264, 5, 187, 39, 166, 1, 449, 14, 251, 55, 256, 1, 1374, 1, 340, 111, 390, 20, 1692, 1, 513, 105, 1610
Offset: 0

Author

Ilya Gutkovskiy, Jan 30 2020

Keywords

Examples

			a(12) = 5 because we have [12], [10, 2], [9, 3], [8, 4] and [6, 4, 2].
		

Crossrefs

Cf. A036998, A121998, A175787 (positions of 1's), A303280, A331885, A331888.

Programs

  • Maple
    a:= proc(m) option remember; local b; b:=
          proc(n, i) option remember; `if`(i*(i+1)/21, b(n-i, min(i-1, n-i)), 0)+b(n, i-1)))
          end; forget(b); b(m$2)
        end:
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    Table[SeriesCoefficient[Product[(1 + Boole[GCD[k, n] > 1] x^k), {k, 1, n}], {x, 0, n}], {n, 0, 70}]
  • PARI
    A331887(n) = { my(p = Ser(1, 'x, 1+n)); for(k=2, n, if(gcd(n,k)>1, p *= (1 + 'x^k))); polcoef(p, n); }; \\ Antti Karttunen, Jan 25 2025

Formula

a(n) = [x^n] Product_{k: gcd(n,k) > 1} (1 + x^k).

A332002 Number of compositions (ordered partitions) of n into distinct parts all relatively prime to n.

Original entry on oeis.org

1, 1, 0, 2, 2, 4, 2, 12, 4, 6, 4, 64, 4, 132, 6, 32, 32, 616, 6, 1176, 32, 120, 58, 4756, 32, 3452, 108, 1632, 132, 30460, 8, 55740, 376, 3872, 352, 18864, 132, 315972, 1266, 13368, 352, 958264, 108, 1621272, 2228, 10176, 6166, 4957876, 352, 2902866, 2132
Offset: 0

Author

Ilya Gutkovskiy, Feb 04 2020

Keywords

Examples

			a(9) = 6 because we have [8, 1], [7, 2], [5, 4], [4, 5], [2, 7] and [1, 8].
		

Programs

  • Maple
    a:= proc(n) local b; b:=
          proc(m, i, p) option remember; `if`(m=0, p!, `if`(i<1, 0,
            b(m, i-1, p)+`if`(i>m or igcd(i, n)>1, 0, b(m-i, i-1, p+1))))
          end; forget(b): b(n$2, 0)
        end:
    seq(a(n), n=0..63);  # Alois P. Heinz, Feb 04 2020
  • Mathematica
    a[n_] := Module[{b}, b[m_, i_, p_] := b[m, i, p] = If[m == 0, p!, If[i < 1, 0, b[m, i-1, p] + If[i > m || GCD[i, n] > 1, 0, b[m-i, i-1, p+1]]]]; b[n, n, 0]];
    a /@ Range[0, 63] (* Jean-François Alcover, Nov 26 2020, after Alois P. Heinz *)

A082415 Numbers n such that in all partitions of n into distinct coprimes these coprimes are also mutually relatively prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 14, 16, 18, 22, 24, 30
Offset: 1

Author

Reinhard Zumkeller, Apr 23 2003

Keywords

Comments

A083290(a(n)) = A036998(a(n)).

Examples

			8=1+7=3+5, so 8 is a term because of 1 _|_ 7 and 3 _|_ 5.
		

A338438 a(n) = n! * [x^n] Product_{k=1..n, gcd(n,k) = 1} (1 + x^k/k!).

Original entry on oeis.org

1, 1, 0, 3, 4, 15, 6, 168, 64, 171, 130, 44418, 804, 802750, 2380, 683595, 5782144, 840363295, 40410, 24358246734, 221953840, 3114081516, 5372831860, 62269802986834, 25703183400, 548547778815000, 3028000483716, 9604167089258628, 30673543523224, 13242158988496348746
Offset: 0

Author

Ilya Gutkovskiy, Oct 27 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n! SeriesCoefficient[Product[(1 + Boole[GCD[n, k] == 1] x^k/k!), {k, 1, n}], {x, 0, n}], {n, 0, 29}]

A338439 a(n) = n! * [x^n] Product_{k=1..n, gcd(n,k) = 1} (1 + x^k/k).

Original entry on oeis.org

1, 1, 0, 3, 8, 50, 144, 2394, 8448, 89424, 576000, 20124720, 57231360, 3213905760, 11285084160, 217204092000, 2843121254400, 187660890063360, 558255985459200, 64849189355274240, 239933887119360000, 8405611881201561600, 116110668405473280000, 13912098832249673932800
Offset: 0

Author

Ilya Gutkovskiy, Oct 27 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n! SeriesCoefficient[Product[(1 + Boole[GCD[n, k] == 1] x^k/k), {k, 1, n}], {x, 0, n}], {n, 0, 23}]
Showing 1-8 of 8 results.