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-4 of 4 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

A331888 Number of compositions (ordered partitions) of n into parts having a common factor > 1 with n.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 5, 1, 8, 4, 17, 1, 60, 1, 65, 19, 128, 1, 800, 1, 683, 67, 1025, 1, 11005, 16, 4097, 256, 9203, 1, 369426, 1, 32768, 1027, 65537, 79, 2124475, 1, 262145, 4099, 1424118, 1, 48987720, 1, 2127107, 96334, 4194305, 1, 411836297, 64, 67919981, 65539
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2020

Keywords

Examples

			a(9) = 4 because we have [9], [6, 3], [3, 6] and [3, 3, 3].
		

Crossrefs

Cf. A182986 (positions of 1's), A100347, A121998, A178472, A331885, A331887.

Programs

  • Maple
    a:= proc(m) option remember; local b; b:=
          proc(n) option remember; `if`(n=0, 1,
            add(`if`(igcd(j, m)>1, b(n-j), 0), j=1..n))
          end; forget(b); b(m$2)
        end:
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    Table[SeriesCoefficient[1/(1 - Sum[Boole[GCD[k, n] > 1] x^k, {k, 1, n}]), {x, 0, n}], {n, 0, 51}]

Formula

a(n) = [x^n] 1 / (1 - Sum_{k: gcd(n,k) > 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

Views

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].
		

Crossrefs

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 *)

A332003 Number of compositions (ordered partitions) of n into distinct parts having a common factor > 1 with n.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 3, 1, 3, 3, 5, 1, 13, 1, 13, 7, 19, 1, 59, 1, 59, 15, 65, 1, 309, 5, 133, 27, 195, 1, 2883, 1, 435, 67, 617, 17, 4133, 1, 1177, 135, 2915, 1, 36647, 1, 3299, 1767, 4757, 1, 52045, 13, 21149, 619, 11307, 1, 187307, 69, 29467, 1179, 30461
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 04 2020

Keywords

Examples

			a(6) = 3 because we have [6], [4, 2] and [2, 4].
		

Crossrefs

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 *)
Showing 1-4 of 4 results.