OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
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
a(n) = decimal(A007924(n)).
a(n) mod 2 = A121559(n) for n>=1. - Alois P. Heinz, Jun 12 2023
EXAMPLE
8=7+1, hence A007924(8)=10001, so a(8)=17.
MAPLE
a:= proc(n) option remember; local m, p, r; m:=n; r:=0;
while m>0 do
if m=1 then r:=r+1; break fi;
p:= prevprime(m+1); m:= m-p;
r:= r+2^numtheory[pi](p)
od; r
end:
seq(a(n), n=0..52); # Alois P. Heinz, Jun 12 2023
MATHEMATICA
cprime[n_Integer] := If[n==0, 1, Prime[n]]; gentable[n_Integer] := (m=n; ptable={}; While[m != 0, (i = 0; While[cprime[i] <= m, i++]; j=0; While[j<i, AppendTo[ptable, 0]; j++]; ptable[[i]]=1; m=m-cprime[i-1])]; ptable); decimal[n_Integer] := (gentable[n]; Sum[2^(k - 1)*ptable[[k]], {k, 1, Length[ptable]}]); Table[decimal[n], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Nov 24 2011
EXTENSIONS
Edited by N. J. A. Sloane, May 20 2023
STATUS
approved