login

Revision History for A327442

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(0) = 0; thereafter a(n) = a(n-1) + phi(n) if phi(n) > a(n-1), otherwise a(n) = a(n-1) - phi(n), where phi is the Euler phi-function A000010.
(history; published version)
#15 by Harvey P. Dale at Wed Jun 14 13:26:01 EDT 2023
STATUS

editing

approved

#14 by Harvey P. Dale at Wed Jun 14 13:25:59 EDT 2023
MATHEMATICA

nxt[{n_, a_}]:=Module[{ph=EulerPhi[n+1]}, {n+1, If[ph>a, a+ph, a-ph]}]; NestList[nxt, {0, 0}, 80][[;; , 2]] (* Harvey P. Dale, Jun 14 2023 *)

STATUS

approved

editing

#13 by Joerg Arndt at Sun Nov 01 06:07:50 EST 2020
STATUS

reviewed

approved

#12 by Michel Marcus at Sun Nov 01 04:48:32 EST 2020
STATUS

proposed

reviewed

#11 by Jean-François Alcover at Sun Nov 01 02:07:50 EST 2020
STATUS

editing

proposed

#10 by Jean-François Alcover at Sun Nov 01 02:07:43 EST 2020
MATHEMATICA

a[0] = 0; a[n_] := a[n] = With[{phi = EulerPhi[n], a1 = a[n-1]}, If[phi>a1, a1+phi, a1-phi]];

a /@ Range[0, 80] (* Jean-François Alcover, Nov 01 2020 *)

STATUS

approved

editing

#9 by Alois P. Heinz at Sat Jan 11 08:26:08 EST 2020
STATUS

editing

approved

#8 by Alois P. Heinz at Sat Jan 11 08:26:05 EST 2020
CROSSREFS
#7 by Alois P. Heinz at Sat Jan 11 08:24:55 EST 2020
MAPLE

a:= proc(n) option remember; `if`(n<1, 0, ((s, t)-> s+

`if`(s<t, t, -t))(a(n-1), numtheory[phi](n)))

end:

seq(a(n), n=0..80); # Alois P. Heinz, Jan 11 2020

CROSSREFS

Cf. A000010.

STATUS

approved

editing

#6 by N. J. A. Sloane at Thu Sep 12 20:37:32 EDT 2019
STATUS

editing

approved