OFFSET
1,2
COMMENTS
FORMULA
EXAMPLE
a(1) = 1 by convention.
a(2) = 3 = 2^0 + 2^1, since the Lucas sequence contains both even and odd numbers.
a(5) = 30 = 2^1 + 2^2 + 2^3 + 2^4, since the Lucas numbers mod 5 is {2,1,3,4,2,1} repeated, and we are missing 0, leaving the exponents of 2 as shown.
Binary equivalents of first terms:
n a(n) a(n) in binary
--------------------------
1 1 1
2 3 11
3 7 111
4 15 1111
5 30 11110
6 63 111111
7 127 1111111
8 190 10111110
9 511 111111111
10 990 1111011110
11 1183 10010011111
12 3582 110111111110
13 8190 1111111111110
14 16383 11111111111111
15 18590 100100010011110
16 47806 1011101010111110
...
MATHEMATICA
Total /@ {Most@ #, #} &[2^Range[0, 1]]~Join~Array[Block[{w = {2, 1}}, Do[If[SequenceCount[w, {2, 1}] == 1, AppendTo[w, Mod[Total@ w[[-2 ;; -1]], #]], Break[]], {i, 2, Infinity}]; Total[2^Union@ w]] &, 32, 3]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Oct 07 2020
STATUS
approved