OFFSET
0,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8192
FORMULA
MATHEMATICA
a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[PrimeOmega[Times @@ (FactorInteger[#] /. {p_, e_} /; e > 0 :> (p^Mod[PrimePi@ p + 1, 2])^e) &@ a@ n], {n, 0, 118}] (* or *)
a[n_] := Which[n < 2, n, EvenQ@ n, a[n/2], True, a[(n - 1)/2] + a[(n + 1)/2]]; Table[(a[n] - JacobiSymbol[n, 3])/2, {n, 0, 118}] (* Michael De Vlieger, Apr 05 2017, after Alonso del Arte at A102283 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A284556 n) (cond ((<= n 1) 0) ((even? n) (A000360with_prep_0 (/ n 2))) (else (+ (A284556 (/ (- n 1) 2)) (A284556 (/ (+ n 1) 2))))))
(definec (A000360with_prep_0 n) (cond ((<= n 1) n) ((even? n) (A284556 (/ n 2))) (else (+ (A000360with_prep_0 (/ (- n 1) 2)) (A000360with_prep_0 (/ (+ n 1) 2))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 05 2017
STATUS
approved