cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A352328 Nonnegative numbers that are the sum of distinct Pell numbers (A000129).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 12 2022

Keywords

Comments

This sequence is the complement of A352323.
Although this is a list, it has offset 0 for mathematical reasons: indeed, so, the binary expansion of n encodes the positive Pell numbers summing to a(n).
Every nonnegative integer is the sum of two (not necessarily distinct) terms of this sequence.

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.
		

Crossrefs

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) }

Formula

a(n) = Sum_{k >= 0} b_k * A000129(k+1) where Sum_{k >= 0} b_k * 2^k is the binary expansion of n.
A265744(a(n)) = A000120(n).