%I #31 May 09 2021 11:17:51
%S 2,3,4,5,5,7,2,3,3,11,5,13,5,7,8,17,2,19,2,10,3,23,5,5,11,9,5,29,10,
%T 31,2,5,7,11,5,37,17,7,7,41,5,43,5,11,10,47,4,7,2,11,17,53,3,7,4,13,9,
%U 59,12,61,29,11,4,11,2,67,5,17,14,71,12,73,11,3,7,5,5
%N Final divisor of A238529(n).
%C Conjecture: Every integer greater than 1, except 6, is an element of the sequence.
%H Tom Davis, <a href="/A238714/b238714.txt">Table of n, a(n) for n = 2..10001</a>
%e a(8) = 2, because 8 mod sopfr(8) = 8 mod 6 = 2, and 2 mod sopfr(2) = 2 mod 2 = 0, and 2 is the last divisor used.
%e a(21) = 10, because 21 mod sopfr(21) = 21 mod 10 = 1, and 10 is the last divisor used.
%o (Python)
%o def primfacs(n):
%o i = 2
%o primfac = []
%o while i * i <= n:
%o while n % i == 0:
%o primfac.append(i)
%o n //= i
%o i += 1
%o if n > 1:
%o primfac.append(n)
%o return primfac
%o def sopfr(n):
%o plist = primfacs(n)
%o l = len(plist)
%o s = 0
%o while l > 0:
%o s += plist[l - 1]
%o l -= 1
%o return s
%o n = 2
%o max = 1000
%o lst = []
%o while n <= max:
%o rem = n
%o while rem > 1:
%o last = sopfr(rem)
%o rem = rem % last
%o lst.append(last)
%o n += 1
%o print(lst)
%Y Cf. A238529.
%K nonn
%O 2,1
%A _J. Stauduhar_, Mar 03 2014
|