A337673 a(n) is the sum of all positive integers whose Collatz orbit has length n.
0, 1, 2, 4, 8, 16, 37, 74, 172, 344, 786, 1572, 3538, 7206, 16252, 33112, 73762, 149967, 330107, 678610, 1498356, 3082302, 6742487, 13855154, 30122440, 62388962, 135783788, 281177482, 608402189, 1259151448, 2711432766, 5646008216, 12172417990, 25339969480, 54409676729, 113159496364
Offset: 0
Keywords
Examples
a(6) = 5+32 = 37 as the positive integers whose Collatz orbit has length 6 are {5,32} - the orbit of 5 is 5,16,8,4,2,1, and the orbit of 32 is 32,16,8,4,2,1.
Programs
-
PARI
nextSet(s) = { my(s1 = Set([])); for(i = 1, #s, s1 = setunion(s1, Set([2*s[i]])); if (s[i] > 4 && (s[i]-1) % 3 == 0 && (s[i]-1)/3 % 2 == 1, s1 = setunion(s1, Set([(s[i]-1)/3]))); ); return(s1); } a(n) = { my(s = Set([1])); for(k = 1, n, s = nextSet(s); ); return(sum(i=1,#s,s[i])); }
Extensions
More terms from David A. Corneth, Sep 15 2020
Comments