OFFSET
1,1
COMMENTS
Note that the majority of the terms (every other term, initially) are equal to b(2), which is 13. This happens with several other values of b(2) less than 20. Many other values for b(2) have been tested, and it seems that for all b(2) < 100000000, a(n) < 20.
Records 8, 13, 15, 16, 19, 20, 24, ... occur at 1, 2, 3, 13, 349, 3919, 55633, ...
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
EXAMPLE
n = 6; the sequence is:
6, 13, 15, 18, 6, 5, 7, 12, 10, 7, 9, 10, 8, 4, 4, 4, ...
There are 13 terms before the first of the infinite 4s; a(6) = 13.
For n = 55633 the sequence is: 55633, 13, 55646, 27836, 6961, 6963, 7172, 166, 85, 19, 24, 22, 13, 15, 18, 6, 5, 7, 12, 10, 7, 9, 10, 8, 4, 4, 4, ... . As the first 4 comes as the 25th term, a(55633) = 24. - Antti Karttunen, Oct 01 2018
MATHEMATICA
Table[
Clear[h];
h[1]=x;
h[2]=13;
h[n_]:=FactorInteger[h[n-1]][[-1, 1]]+FactorInteger[h[n-2]][[1, 1]];
Position[Array[h, 100], 4][[1, 1]]-1,
{x, 1, 100}] (*This only works for x≠4*)
PROG
(PARI)
A020639(n) = if(1==n, n, factor(n)[1, 1]);
A271720(n) = { my(up=1001, bvec = vector(up), m=1); bvec[1] = n; bvec[2] = 13; for(n=3, oo, bvec[n] = A020639(bvec[n-2])+A006530(bvec[n-1]); if(4==bvec[n], return(n-1))); }; \\ Antti Karttunen, Oct 01 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Cody M. Haderlie, Apr 12 2016
STATUS
approved