A201997 a(n) is the decimal value of the binary vector used to select terms of A075058 whose sum is n.
0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 60, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87
Offset: 0
Examples
For n=22, the binary vector when applied to A075058 is {0,1,0,1,1,0,...}, consequently 2+7+13=22. The decimal value of the binary vector (in ascending powers of 2) is 26, so a(22)=26.
Links
- Wikipedia, "Complete" sequence. [Wikipedia calls a sequence "complete" (sic) if every positive integer is a sum of distinct terms. This name is extremely misleading and should be avoided. - _N. J. A. Sloane_, May 20 2023]
Programs
-
Mathematica
prevprime[n_Integer] := (j=n; If[n==1, 1, While[!PrimeQ[j], j--]; j]); aprime[n_Integer] := (aprime[n]=prevprime[Sum[aprime[m], {m, 0, n - 1}] + 1]); gentable[n_Integer] := (m=n; ptable={0}; While[m!=0, (i=0; While[aprime[i]<=m && ptable[[i + 1]]!=1, (AppendTo[ptable, 0];i++)]; ptable[[i]] = 1; m = m - aprime[i - 1])]; ptable); decimal[n_Integer] := (gentable[n]; Sum[2^(k-1)*ptable[[k]], {k, 1, Length[ptable]}]); aprime[0]=1; Table[decimal[r], {r,0,100}]
Formula
Binary(a(n)) x A075058 = n, where x is the inner product and the binary vector is in ascending powers of 2 with infinite trailing zeros.
Extensions
Edited by N. J. A. Sloane, May 20 2023
Comments