|
|
A292245
|
|
Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+1 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.
|
|
8
|
|
|
1, 2, 2, 5, 4, 4, 11, 4, 8, 17, 10, 18, 9, 8, 22, 17, 8, 8, 17, 22, 36, 41, 8, 42, 17, 16, 44, 21, 34, 32, 35, 20, 32, 33, 36, 64, 69, 18, 34, 73, 16, 74, 37, 44, 82, 33, 34, 34, 89, 16, 64, 69, 16, 68, 65, 34, 64, 33, 44, 64, 33, 72, 16, 65, 82, 68, 85, 16, 128, 137, 84, 72, 69, 34, 138, 145, 32, 84, 145, 88, 88, 149, 42, 162, 65, 68, 164, 45, 64
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 1; for n > 1, a(n) = 2*a(A253889(n)) + [n ≡ 1 (mod 3)], where the last part of the formula is Iverson bracket, giving 1 only if n is of the form 3k+1, and 0 otherwise.
Other identities. For all n >= 1:
|
|
EXAMPLE
|
For n=1 (the termination value of the iteration), 1 is of the form 3k+1, thus a(1) = 1*(2^0) = 1.
For n=2, 2 is not of the form 3k+1, while A253889(2) = 1 is, thus a(2) = 0*(2^0) + 1*2(^1) = 2.
For n=4, 4 is of the form 3k+1, while A253889(4) = 2 is not, but then A253889(2) = 1 again is, thus a(4) = 1*(2^0) + 0*(2^1) + 1*(2^2) = 5.
|
|
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] /. 2 -> 0] &, Array[a, 98]] (* Michael De Vlieger, Sep 16 2017 *)
|
|
PROG
|
(Scheme, with memoization-macro definec)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|