A375567 Length of the "exponential comma sequence" with n as the initial term, or -1 if that sequence is infinite.
-1, 3, 4, 1, 2, 3, 5, 4, 4, -1, 5, 1, 1, 4, 1, 1, 1, 1, 1, 6, 1, 11, 4, 9, 5, 1, 7, 2, 3, 1, 1, 1, 6, 3, 1, 6, 4, 1, 7, 1, 3, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 4, 7, 2, 4, 1, 2, 1, 3, 2, 1, 8, 3, 1, 6, 2, 1, 2, 2, 3, 3, 4, 3, 5, 1, 5, 3, 2, 1, 3, 2, 3, 4, 3
Offset: 1
Examples
For n = 2, the next term of its exponential comma sequence is 67108864 because log_2(67108864) = 26 and this is the smallest number where the exponential comma property holds.
Links
- Kevin Ryde, Table of n, a(n) for n = 1..10000
- Kevin Ryde, C Code
Programs
-
C
/* See links. */
-
Mathematica
ExponentialCommaSequenceLength[n_] := Module[{seq = {n}, i = 1}, While[True, Do[ If[(IntegerDigits@Power[Last@seq, Mod[Last@commaSeq,10]*10 + j])[[1]] == j, seq = seq~Join~{Power[Last@seq, Mod[Last@commaSeq, 10]*10 + j]}; Break[];];, {j, 1, 9} ]; If[Length@seq != i + 1, Break[];]; If[seq[[1]] == seq[[2]], Return[-1]]; i++; ]; Length@seq ]
Comments