login
A271720
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.
1
8, 13, 15, 13, 4, 13, 12, 13, 15, 13, 4, 13, 16, 13, 15, 13, 12, 13, 15, 13, 15, 13, 4, 13, 4, 13, 15, 13, 8, 13, 12, 13, 15, 13, 4, 13, 12, 13, 15, 13, 4, 13, 8, 13, 15, 13, 12, 13, 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
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
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)
A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1); \\ From A006530
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
Sequence in context: A253775 A168137 A252458 * A243436 A380549 A214412
KEYWORD
nonn
AUTHOR
Cody M. Haderlie, Apr 12 2016
STATUS
approved