OFFSET
0,3
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]
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.
EXAMPLE
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.
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}]
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Frank M Jackson, Dec 07 2011
EXTENSIONS
Edited by N. J. A. Sloane, May 20 2023
STATUS
approved