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.
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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 15 2017
STATUS
approved