login
a(n) = how many of {6,7,8} divide n.
2

%I #22 Nov 09 2022 18:04:31

%S 0,0,0,0,0,1,1,1,0,0,0,1,0,1,0,1,0,1,0,0,1,0,0,2,0,0,0,1,0,1,0,1,0,0,

%T 1,1,0,0,0,1,0,2,0,0,0,0,0,2,1,0,0,0,0,1,0,2,0,0,0,1,0,0,1,1,0,1,0,0,

%U 0,1,0,2,0,0,0,0,1,1,0,1,0,0,0,2,0,0,0,1,0,1,1,0,0,0,0,2,0,1,0,0,0,1

%N a(n) = how many of {6,7,8} divide n.

%D Senechal, Marjorie. "Introduction to lattice geometry." In M. Waldschmidt et al., eds., From Number Theory to Physics, pp. 476-495. Springer, Berlin, Heidelberg, 1992. See Cor. 3.7.

%H Colin Barker, <a href="/A321013/b321013.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n + 168) = a(n). - _David A. Corneth_, Nov 05 2018

%F Conjectures from _Colin Barker_, Nov 05 2018: (Start)

%F G.f.: x^6*(1 + 2*x + 4*x^2 + 5*x^3 + 7*x^4 + 8*x^5 + 10*x^6 + 9*x^7 + 9*x^8 + 6*x^9 + 6*x^10 + 3*x^11 + 3*x^12) / ((1 - x)*(1 + x)*(1 - x + x^2)*(1 + x^2)*(1 + x + x^2)*(1 + x^4)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)).

%F a(n) = -a(n-1) - 2*a(n-2) - 2*a(n-3) - 3*a(n-4) - 3*a(n-5) - 3*a(n-6) - 2*a(n-7) - a(n-8) + a(n-10) + 2*a(n-11) + 3*a(n-12) + 3*a(n-13) + 3*a(n-14) + 2*a(n-15) + 2*a(n-16) + a(n-17) + a(n-18) for n>18.

%F (End)

%F From _David A. Corneth_, Nov 05 2018: (Start)

%F The above conjectures are true. The sequence is periodic with period 168. Let f(x) be the g.f. above. Then f(x + 168) = f(x).

%F The expression for a(n) holds for 19 <= n <= 1000, more than sufficient for a proof. (End)

%e a(24) = 2 because 24 is divisible 6 and 8, i.e., by 2 of the numbers in {6, 7, 8}. _David A. Corneth_, Nov 05 2018

%p d3:=proc(n) local c; c:=0;

%p if (n mod 6)=0 then c:=c+1; fi;

%p if (n mod 7)=0 then c:=c+1; fi;

%p if (n mod 8)=0 then c:=c+1; fi; c; end;

%p [seq(d3(n),n=1..120)];

%t a[n_]:=Sum[If[Mod[n,i]==0, 1, 0], {i ,6, 8}]; Array[a, 120] (* _Stefano Spezia_, Nov 05 2018 *)

%t Table[Total[Boole[Divisible[n,{6,7,8}]]],{n,120}] (* _Harvey P. Dale_, Nov 09 2022 *)

%o (PARI) a(n) = sum(i = 6, 8, !(n%i)) \\ _David A. Corneth_, Nov 05 2018

%K nonn,easy

%O 1,24

%A _N. J. A. Sloane_, Nov 04 2018