%I M2212 N0878 #32 Jul 31 2023 10:08:00
%S 1,1,3,1,2,2,4,2,6,1,8,2,10,2,5,4,14,3,16,2,7,4,20,4,10,5,18,4,26,2,
%T 28,8,16,7,8,6,34,8,20,4,38,3,40,8,12,10,44,8,28,5,30,10,50,9,16,8,33,
%U 13,56,5,58,14,24,16,20,8,64,14,41,4,68,12,70,17,19
%N Number of first n tetrahedral numbers (A000292) that are relatively prime to n.
%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H T. D. Noe, <a href="/A002016/b002016.txt">Table of n, a(n) for n = 1..1000</a>
%H C. C. Yen (Proposer), E. P. Starke (Solver), <a href="https://www.jstor.org/stable/2301445">Problem 272</a>, Amer. Math. Monthly, 41 (1934), 582-587.
%H C. C. Yen (Proposer), E. P. Starke (Solver), <a href="/A002016/a002016.pdf">Problem 272</a>, Amer. Math. Monthly, 41 (1934), 582-587. [Annotated scanned copy]
%F a(n) = number of b(1), ..., b(n) that are relatively prime to n, where b() = A000292().
%e All 3 of 1, 4, 10 are prime to 3, so a(3) = 3.
%t f[n_] := Length@ Select[ Accumulate@ Rest@ FoldList[Plus, 0, Range@ n], GCD[#, n] == 1 &]; Array[f, 83] (* Gabriel Cunningham, Oct 24 2004 *)
%o (PARI) a(n) = sum(k=1, n, gcd(k*(k+1)*(k+2)/6, n) == 1); \\ _Michel Marcus_, Jun 06 2019
%Y Cf. A000292.
%K nonn,easy
%O 1,3
%A _N. J. A. Sloane_
%E More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Oct 24 2004