%I #11 Oct 01 2018 21:08:08
%S 8,13,15,13,4,13,12,13,15,13,4,13,16,13,15,13,12,13,15,13,15,13,4,13,
%T 4,13,15,13,8,13,12,13,15,13,4,13,12,13,15,13,4,13,8,13,15,13,12,13,
%U 12,13,15,13,12,13,4,13,15,13,4,13,8,13,15,13,4,13,12,13,15,13,8,13,11,13,15,13,12,13
%N a(1)=1; for n>1, define a sequence {b(m), m >= 1} by b(1)=n b(2)=13, and b(m) = A020639(b(m-2)) + A006530(b(m-1)); then a(n) is the number of terms in that sequence before the first of the infinite string of 4s.
%C 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.
%C Records 8, 13, 15, 16, 19, 20, 24, ... occur at 1, 2, 3, 13, 349, 3919, 55633, ...
%H Antti Karttunen, <a href="/A271720/b271720.txt">Table of n, a(n) for n = 1..65537</a>
%e n = 6; the sequence is:
%e 6, 13, 15, 18, 6, 5, 7, 12, 10, 7, 9, 10, 8, 4, 4, 4, ...
%e There are 13 terms before the first of the infinite 4s; a(6) = 13.
%e 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
%t Table[
%t Clear[h];
%t h[1]=x;
%t h[2]=13;
%t h[n_]:=FactorInteger[h[n-1]][[-1,1]]+FactorInteger[h[n-2]][[1,1]];
%t Position[Array[h,100],4][[1,1]]-1,
%t {x,1,100}] (*This only works for x≠4*)
%o (PARI)
%o A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1); \\ From A006530
%o A020639(n) = if(1==n, n, factor(n)[1, 1]);
%o 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
%K nonn
%O 1,1
%A _Cody M. Haderlie_, Apr 12 2016