A225563 Numbers whose totient-trajectory can be partitioned into two sets with the same sum.
3, 5, 7, 9, 11, 13, 15, 17, 25, 27, 31, 33, 35, 39, 41, 49, 51, 55, 61, 65, 69, 77, 81, 85, 87, 91, 95, 97, 103, 111, 115, 119, 121, 123, 125, 133, 137, 141, 143, 145, 153, 155, 159, 161, 175, 183, 185, 187, 193, 201, 203, 205, 209, 213, 215, 217, 219, 221
Offset: 1
Keywords
Examples
17 is in the sequence because its totient-trajectory is {17,16,8,4,2,1}, which can be partitioned into 17+4+2+1 = 16+8.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Christian N. K. Anderson)
- Christian N. K. Anderson, Decomposition of the first 1000 terms.
Programs
-
Mathematica
totQ[n_] := Module[{it = Most@FixedPointList[EulerPhi, n], sum, x}, sum = Plus @@ it; If[OddQ[sum], False, CoefficientList[Product[1 + x^i, {i, it}], x][[1 +sum/2]] > 0]]; Select[Range[221], totQ] (* Amiram Eldar, May 24 2020 *)
-
R
library(numbers); totseq<-function(x) { while(x[length(x)]>1) x[length(x)+1]=eulersPhi(x[length(x)]); x }; eqsum<-function(xvec) { mkgrp<-function(grp) { if(length(grp)==length(xvec)) { tapply(xvec,grp,sum)->tot; if(length(tot)==2) if(tot[1]==tot[2]) {faxp<<-grp; return(T)}; return(F); } ifelse(mkgrp(c(grp,1)),T,mkgrp(c(grp,2))); } ifelse(length(xvec)<2,F,mkgrp(c())); } which(sapply(2*(1:100)-1,function(x) eqsum(totseq(x))))*2-1
Extensions
Edited by N. J. A. Sloane, May 17 2013
Comments