|
|
A052331
|
|
Inverse of A052330; A binary encoding of Fermi-Dirac factorization of n, shown in decimal.
|
|
44
|
|
|
0, 1, 2, 4, 8, 3, 16, 5, 32, 9, 64, 6, 128, 17, 10, 256, 512, 33, 1024, 12, 18, 65, 2048, 7, 4096, 129, 34, 20, 8192, 11, 16384, 257, 66, 513, 24, 36, 32768, 1025, 130, 13, 65536, 19, 131072, 68, 40, 2049, 262144, 258, 524288, 4097, 514, 132, 1048576, 35
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Every number can be represented uniquely as a product of numbers of the form p^(2^k), sequence A050376. This sequence is a binary representation of this factorization, with a(p^(2^k)) = 2^(i-1), where i is the index (A302778) of p^(2^k) in A050376. Additive with a(p^e) = sum a(p^(2^e_k)) where e = sum(2^e_k) is the binary representation of e and a(p^(2^k)) is as described above. - Franklin T. Adams-Watters, Oct 25 2005 - Index offset corrected by Antti Karttunen, Apr 17 2018
|
|
LINKS
|
|
|
FORMULA
|
(End)
|
|
EXAMPLE
|
|
|
PROG
|
(PARI) A052331=a(n)={for(i=1, #n=factor(n)~, n[2, i]>1||next; m=binary(n[2, i]); n=concat(n, Mat(vector(#m-1, j, [n[1, i]^2^(#m-j), m[j]]~))); n[2, i]%=2); n||return(0); m=vecsort(n[1, ]); forprime(p=1, m[#m], my(j=0); while(p^2^j<m[#m], setsearch(m, p^2^j)||n=concat(n, [p^2^j, 0]~); j++)); vector(#n=vecsort(n), i, 2^i)*n[2, ]~>>1} \\ M. F. Hasler, Apr 08 2015
(PARI)
up_to_e = 8192;
v050376 = vector(up_to_e);
ispow2(n) = (n && !bitand(n, n-1));
i = 0; for(n=1, oo, if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e, break));
A052331(n) = { my(s=0, e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); }; \\ Antti Karttunen, Apr 12 2018
|
|
CROSSREFS
|
Cf. A050376, A052330, A064547, A302024, A302029, A302776, A302778, A302785, A302786, A302787, A302790, A302784.
Cf. A182979 (same sequence shown in binary).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|