login
A283470
a(n) = A004001(A004001(n-1)) XOR A004001(n-A004001(n-1)), a(1) = a(2) = 1.
8
1, 1, 0, 0, 3, 0, 0, 0, 1, 0, 7, 7, 0, 0, 0, 0, 1, 0, 3, 2, 2, 1, 14, 14, 15, 15, 15, 0, 0, 0, 0, 0, 1, 0, 3, 2, 5, 5, 6, 7, 4, 4, 5, 4, 4, 3, 3, 3, 2, 29, 29, 30, 30, 30, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 1, 0, 3, 2, 5, 4, 4, 7, 4, 5, 10, 10, 11, 10, 9, 9, 14, 15, 15, 14, 14, 14, 13, 10, 11, 11, 10, 9, 9, 6, 6, 6, 7, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3
OFFSET
1,5
LINKS
FORMULA
a(n) = A004001(A004001(n-1)) XOR A004001(A080677(n-1)), where XOR is bitwise-xor (A003987)
Other identities. For all n >= 1:
a(n) = A283469(n) - A283472(n).
A004001(n) = a(n) + 2*A283472(n).
MATHEMATICA
a[n_] := a[n] = If[n <= 2, 1, a[a[n - 1]] + a[n - a[n - 1]]]; Table[BitXor[a[#], a[n - #]] &@ a[n - 1] + Boole[n <= 2], {n, 107}] (* Michael De Vlieger, Mar 18 2017, after Robert G. Wilson v at A004001 *)
PROG
(Scheme)
(define (A283470 n) (if (<= n 2) 1 (A003987bi (A004001 (A004001 (- n 1))) (A004001 (- n (A004001 (- n 1)))))))
;; A003987bi implements bitwise-XOR (see A003987). Code for A004001 given under that entry.
CROSSREFS
Cf. A003987, A080677, A283468, A283469, A283472, A283471 (positions of zeros), A283473 (positions where coincides with A004001).
Cf. also A283677.
Sequence in context: A069531 A335487 A035677 * A101941 A089313 A052998
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 18 2017
EXTENSIONS
Erroneous b-file replaced by a correct one - Antti Karttunen, Feb 24 2018
STATUS
approved