The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A100347 Number of compositions of n into parts all relatively prime to n. 5

%I #22 Dec 22 2016 09:57:33

%S 1,1,1,3,3,15,3,63,21,125,36,1023,25,4095,314,3357,987,65535,207,

%T 262143,2782,164498,17114,4194303,1705,11349545,119620,7256527,209376,

%U 268435455,1261,1073741823,2178309,276465135,5687872,8460492865,114575,68719476735

%N Number of compositions of n into parts all relatively prime to n.

%H Alois P. Heinz, <a href="/A100347/b100347.txt">Table of n, a(n) for n = 0..1000</a>

%F Coefficient of x^n in expansion of 1/(1-Sum_{d : gcd(d, n)=1} x^d ).

%e a(4) = 3 because among the eight compositions of 4 (namely, 1111, 112, 121, 211, 22, 13, 31 and 4) only 1111, 13 and 31 have parts all relatively prime to 4.

%p RP:=proc(n) local A, j: A:={}: for j from 1 to n do if gcd(j, n)=1 then A:=A union {j} fi od: A end: a:=proc(n) local S, j, ser: S:=1/(1-sum(x^RP(n)[j], j=1..nops(RP(n)))): ser:=series(S, x=0, n+5): coeff(ser, x^n): end: 1, seq(a(n), n=1..40); # _Emeric Deutsch_, Jul 25 2005

%p # second Maple program:

%p b:= proc(n, m) option remember; `if`(n=0, 1,

%p add(`if`(igcd(i, m)>1, 0, b(n-i, m)), i=1..n))

%p end:

%p a:= n-> b(n$2):

%p seq(a(n), n=0..50); # _Alois P. Heinz_, Aug 30 2014

%t b[n_, m_] := b[n, m] = If[n == 0, 1, Sum[If[GCD[i, m] > 1, 0, b[n - i, m]], {i, 1, n}]]; a[n_] := b[n, n]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Dec 22 2016, after _Alois P. Heinz_ *)

%Y Cf. A057562.

%K easy,nonn

%O 0,4

%A _Vladeta Jovovic_, Dec 29 2004

%E More terms from _Emeric Deutsch_, Jul 25 2005

%E a(0) from _Alois P. Heinz_, Aug 30 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 22:00 EDT 2024. Contains 373134 sequences. (Running on oeis4.)