OFFSET
1,3
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
C. C. Yen (Proposer), E. P. Starke (Solver), Problem 272, Amer. Math. Monthly, 41 (1934), 582-587.
C. C. Yen (Proposer), E. P. Starke (Solver), Problem 272, Amer. Math. Monthly, 41 (1934), 582-587. [Annotated scanned copy]
FORMULA
a(n) = number of b(1), ..., b(n) that are relatively prime to n, where b() = A000292().
EXAMPLE
All 3 of 1, 4, 10 are prime to 3, so a(3) = 3.
MATHEMATICA
f[n_] := Length@ Select[ Accumulate@ Rest@ FoldList[Plus, 0, Range@ n], GCD[#, n] == 1 &]; Array[f, 83] (* Gabriel Cunningham, Oct 24 2004 *)
PROG
(PARI) a(n) = sum(k=1, n, gcd(k*(k+1)*(k+2)/6, n) == 1); \\ Michel Marcus, Jun 06 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Oct 24 2004
STATUS
approved