|
|
A292246
|
|
Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+2 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.
|
|
6
|
|
|
0, 1, 0, 2, 3, 0, 4, 1, 2, 14, 5, 12, 6, 7, 8, 2, 1, 0, 0, 9, 26, 22, 3, 20, 6, 5, 16, 10, 29, 10, 4, 11, 30, 2, 25, 60, 56, 13, 28, 54, 15, 48, 24, 17, 44, 8, 5, 12, 38, 3, 30, 26, 1, 24, 20, 1, 18, 6, 19, 62, 14, 53, 4, 14, 45, 0, 42, 7, 124, 118, 41, 50, 58, 13, 116, 106, 11, 40, 104, 33, 32, 98, 21, 92, 6, 59, 88, 18, 21, 82, 76, 9, 34, 36, 23, 74
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 0; for n > 1, a(n) = 2*a(A253889(n)) + floor((n mod 3)/2).
|
|
EXAMPLE
|
For n = 2, the starting value is of the form 3k+2, after which follows A253889(3) = 1, the end point of iteration, which is not, thus a(2) = 1*(2^0) = 1.
For n = 4, the starting value is not of the form 3k+2, while A253889(4) = 2 is, thus a(4) = 0*(2^0) + 1*(2^1) = 2.
|
|
MATHEMATICA
|
f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; Map[FromDigits[#, 2] &[IntegerDigits[#, 3] /. d_ /; d > 0 :> d - 1] &, Array[a, 96]] (* Michael De Vlieger, Sep 16 2017 *)
|
|
PROG
|
(Scheme, with memoization-macro definec)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|