A375567 Length of the "exponential comma sequence" with n as the initial term, or -1 if that sequence is infinite.
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