A352328 Nonnegative numbers that are the sum of distinct Pell numbers (A000129).
0, 1, 2, 3, 5, 6, 7, 8, 12, 13, 14, 15, 17, 18, 19, 20, 29, 30, 31, 32, 34, 35, 36, 37, 41, 42, 43, 44, 46, 47, 48, 49, 70, 71, 72, 73, 75, 76, 77, 78, 82, 83, 84, 85, 87, 88, 89, 90, 99, 100, 101, 102, 104, 105, 106, 107, 111, 112, 113, 114, 116, 117, 118
Offset: 0
Examples
For n = 42: - 42 = 2^5 + 2^3 + 2^1, - so a(42) = A000129(5+1) + A000129(3+1) + A000129(1+1) = 70 + 12 + 2 = 84.
Links
- L. Carlitz, Richard Scoville, and V. E. Hoggatt, Jr., Pellian Representations, The Fibonacci Quarterly, Vol. 10, No. 5 (1972), pp. 449-488.
- Index entries for sequences related to binary expansion of n
Programs
-
Mathematica
With[{pell = LinearRecurrence[{2, 1}, {1, 2}, 7]}, Select[Union[Plus @@@ Subsets[pell]], # <= pell[[-1]] &]] (* Amiram Eldar, Mar 12 2022 *)
-
PARI
a(n) = { my (v=0, k); while (n, n-=2^k=valuation(n, 2); v+=([2, 1; 1, 0]^(k+1))[2, 1]); return (v) }
Comments